aboutsummaryrefslogtreecommitdiff
path: root/src/staticobject.h
diff options
context:
space:
mode:
authorElias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com>2020-11-04 16:44:42 +0100
committerGitHub <noreply@github.com>2020-11-04 16:44:42 +0100
commit5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc (patch)
treec980d614fec4a5495798be3e79e033229062c3cd /src/staticobject.h
parent28f6a79706b088c37268a59d90878220dc4ef9c7 (diff)
parent3af10766fd2b58b068e970266724d7eb10e9316b (diff)
downloaddragonfireclient-5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc.tar.xz
Merge branch 'master' into master
Diffstat (limited to 'src/staticobject.h')
-rw-r--r--src/staticobject.h21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/staticobject.h b/src/staticobject.h
index 6fb486193..fd1b78315 100644
--- a/src/staticobject.h
+++ b/src/staticobject.h
@@ -50,16 +50,12 @@ public:
*/
void insert(u16 id, const StaticObject &obj)
{
- if(id == 0)
- {
+ if (id == 0) {
m_stored.push_back(obj);
- }
- else
- {
- if(m_active.find(id) != m_active.end())
- {
- dstream<<"ERROR: StaticObjectList::insert(): "
- <<"id already exists"<<std::endl;
+ } else {
+ if (m_active.find(id) != m_active.end()) {
+ dstream << "ERROR: StaticObjectList::insert(): "
+ << "id already exists" << std::endl;
FATAL_ERROR("StaticObjectList::insert()");
}
m_active[id] = obj;
@@ -69,10 +65,9 @@ public:
void remove(u16 id)
{
assert(id != 0); // Pre-condition
- if(m_active.find(id) == m_active.end())
- {
- warningstream<<"StaticObjectList::remove(): id="<<id
- <<" not found"<<std::endl;
+ if (m_active.find(id) == m_active.end()) {
+ warningstream << "StaticObjectList::remove(): id=" << id
+ << " not found" << std::endl;
return;
}
m_active.erase(id);