Re-apply 972d17baea81ffe6d508b291ef97207a4822e1da...
authornerzhul <loic.blot@unix-experience.fr>
Wed, 22 Apr 2015 09:47:22 +0000 (11:47 +0200)
committernerzhul <loic.blot@unix-experience.fr>
Wed, 22 Apr 2015 09:47:22 +0000 (11:47 +0200)
but not rename the container. Approved-By est31

src/environment.cpp
src/environment.h

index 8ade7fe05a3f40d4388697ed4646e1b887592560..96353dffb90f3afb851779856588cb3c665ebed4 100644 (file)
@@ -1238,7 +1238,7 @@ void ServerEnvironment::step(float dtime)
                        // Read messages from object
                        while(!obj->m_messages_out.empty())
                        {
-                               m_active_object_messages.push_back(
+                               m_active_object_messages.push(
                                                obj->m_messages_out.front());
                                obj->m_messages_out.pop();
                        }
@@ -1462,7 +1462,7 @@ ActiveObjectMessage ServerEnvironment::getActiveObjectMessage()
                return ActiveObjectMessage(0);
 
        ActiveObjectMessage message = m_active_object_messages.front();
-       m_active_object_messages.pop_front();
+       m_active_object_messages.pop();
        return message;
 }
 
index 415a9ec31a208c524e82f1b72f3d1b23d9050908..a25a12db37c9b3aba4b1e861eb086619841abc8d 100644 (file)
@@ -32,6 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include <set>
 #include <list>
+#include <queue>
 #include <map>
 #include "irr_v3d.h"
 #include "activeobject.h"
@@ -378,7 +379,7 @@ private:
        // Active object list
        std::map<u16, ServerActiveObject*> m_active_objects;
        // Outgoing network message buffer for active objects
-       std::list<ActiveObjectMessage> m_active_object_messages;
+       std::queue<ActiveObjectMessage> m_active_object_messages;
        // Some timers
        float m_send_recommended_timer;
        IntervalLimiter m_object_management_interval;