]> git.lizzy.rs Git - minetest.git/blobdiff - src/staticobject.h
Clientiface: remove "value is dummy" from docs
[minetest.git] / src / staticobject.h
index 640747e96dbe3152823d02cb0d6a16444a6582d7..208fb2cc86caf387cf1d9292d06e650d73892a9a 100644 (file)
@@ -23,7 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "irrlichttypes_bloated.h"
 #include <string>
 #include <sstream>
-#include <list>
+#include <vector>
 #include <map>
 #include "debug.h"
 
@@ -54,7 +54,7 @@ class StaticObjectList
 public:
        /*
                Inserts an object to the container.
-               Id must be unique or 0.
+               Id must be unique (active) or 0 (stored).
        */
        void insert(u16 id, StaticObject obj)
        {
@@ -68,8 +68,7 @@ class StaticObjectList
                        {
                                dstream<<"ERROR: StaticObjectList::insert(): "
                                                <<"id already exists"<<std::endl;
-                               assert(0);
-                               return;
+                               FATAL_ERROR("StaticObjectList::insert()");
                        }
                        m_active[id] = obj;
                }
@@ -77,10 +76,10 @@ class StaticObjectList
 
        void remove(u16 id)
        {
-               assert(id != 0);
+               assert(id != 0); // Pre-condition
                if(m_active.find(id) == m_active.end())
                {
-                       dstream<<"WARNING: StaticObjectList::remove(): id="<<id
+                       warningstream<<"StaticObjectList::remove(): id="<<id
                                        <<" not found"<<std::endl;
                        return;
                }
@@ -95,7 +94,7 @@ class StaticObjectList
                from m_stored and inserted to m_active.
                The caller directly manipulates these containers.
        */
-       std::list<StaticObject> m_stored;
+       std::vector<StaticObject> m_stored;
        std::map<u16, StaticObject> m_active;
 
 private: