From 972d17baea81ffe6d508b291ef97207a4822e1da Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Tue, 21 Apr 2015 23:26:34 +0200 Subject: m_active_object_messages is used like a queue. Use std::queue instead of std::list. Also rename to m_active_object_messages_queue --- src/environment.cpp | 8 ++++---- src/environment.h | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/environment.cpp b/src/environment.cpp index 8ade7fe05..e353a16f2 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -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_queue.push( obj->m_messages_out.front()); obj->m_messages_out.pop(); } @@ -1458,11 +1458,11 @@ void ServerEnvironment::getRemovedActiveObjects(v3s16 pos, s16 radius, ActiveObjectMessage ServerEnvironment::getActiveObjectMessage() { - if(m_active_object_messages.empty()) + if(m_active_object_messages_queue.empty()) return ActiveObjectMessage(0); - ActiveObjectMessage message = m_active_object_messages.front(); - m_active_object_messages.pop_front(); + ActiveObjectMessage message = m_active_object_messages_queue.front(); + m_active_object_messages_queue.pop(); return message; } diff --git a/src/environment.h b/src/environment.h index 415a9ec31..e0d8d4328 100644 --- a/src/environment.h +++ b/src/environment.h @@ -33,6 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #include +#include #include "irr_v3d.h" #include "activeobject.h" #include "util/numeric.h" @@ -378,7 +379,7 @@ private: // Active object list std::map m_active_objects; // Outgoing network message buffer for active objects - std::list m_active_object_messages; + std::queue m_active_object_messages_queue; // Some timers float m_send_recommended_timer; IntervalLimiter m_object_management_interval; -- cgit v1.2.3