aboutsummaryrefslogtreecommitdiff
path: root/src/staticobject.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/staticobject.h')
-rw-r--r--src/staticobject.h21
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);