diff options
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/client.cpp b/src/client.cpp index 68815e8e6..d476f920d 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -512,7 +512,7 @@ void Client::step(float dtime) ClientEvent event; event.type = CE_PLAYER_DAMAGE; event.player_damage.amount = damage; - m_client_event_queue.push_back(event); + m_client_event_queue.push(event); } } else if(event.type == CEE_PLAYER_BREATH) { @@ -1429,7 +1429,8 @@ bool Client::getChatMessage(std::wstring &message) { if(m_chat_queue.size() == 0) return false; - message = m_chat_queue.pop_front(); + message = m_chat_queue.front(); + m_chat_queue.pop(); return true; } @@ -1445,14 +1446,14 @@ void Client::typeChatMessage(const std::wstring &message) // Show locally if (message[0] == L'/') { - m_chat_queue.push_back((std::wstring)L"issued command: " + message); + m_chat_queue.push((std::wstring)L"issued command: " + message); } else { LocalPlayer *player = m_env.getLocalPlayer(); assert(player != NULL); std::wstring name = narrow_to_wide(player->getName()); - m_chat_queue.push_back((std::wstring)L"<" + name + L"> " + message); + m_chat_queue.push((std::wstring)L"<" + name + L"> " + message); } } @@ -1545,13 +1546,15 @@ void Client::addUpdateMeshTaskForNode(v3s16 nodepos, bool ack_to_server, bool ur ClientEvent Client::getClientEvent() { - if(m_client_event_queue.size() == 0) - { - ClientEvent event; + ClientEvent event; + if(m_client_event_queue.size() == 0) { event.type = CE_NONE; - return event; } - return m_client_event_queue.pop_front(); + else { + event = m_client_event_queue.front(); + m_client_event_queue.pop(); + } + return event; } float Client::mediaReceiveProgress() @@ -1669,7 +1672,7 @@ void Client::makeScreenshot(IrrlichtDevice *device) } else { sstr << "Failed to save screenshot '" << filename << "'"; } - m_chat_queue.push_back(narrow_to_wide(sstr.str())); + m_chat_queue.push(narrow_to_wide(sstr.str())); infostream << sstr.str() << std::endl; image->drop(); } |