diff options
author | Elias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com> | 2020-11-04 16:57:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 16:57:47 +0100 |
commit | 3e16c3a78fff61c20e63ba730d15e94e3bb877b4 (patch) | |
tree | c070350db219f2c4241d22bc31949685c7b42fe9 /src/staticobject.h | |
parent | 5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc (diff) | |
parent | 6ccb5835ff55d85156be91473c598eca9d6cb9a6 (diff) | |
download | dragonfireclient-3e16c3a78fff61c20e63ba730d15e94e3bb877b4.tar.xz |
Merge branch 'master' into master
Diffstat (limited to 'src/staticobject.h')
-rw-r--r-- | src/staticobject.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/staticobject.h b/src/staticobject.h index fd1b78315..6fb486193 100644 --- a/src/staticobject.h +++ b/src/staticobject.h @@ -50,12 +50,16 @@ 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; @@ -65,9 +69,10 @@ 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); |