aboutsummaryrefslogtreecommitdiff
path: root/src/network/clientpackethandler.cpp
diff options
context:
space:
mode:
authorred-001 <red-001@outlook.ie>2018-01-26 15:05:47 +0000
committerLoïc Blot <nerzhul@users.noreply.github.com>2018-01-26 16:05:47 +0100
commit4f688d5616268f0d077b7e925933f54920120da4 (patch)
tree43a80603fb03623f1a51fcce42b7904203cad113 /src/network/clientpackethandler.cpp
parent3a5959ae6b268087709dd64b8e723c42defd5463 (diff)
downloadminetest-4f688d5616268f0d077b7e925933f54920120da4.tar.gz
minetest-4f688d5616268f0d077b7e925933f54920120da4.tar.bz2
minetest-4f688d5616268f0d077b7e925933f54920120da4.zip
Fix issues with earlier CSM HUD commit (#6940)
The CSM HUD PR caused some strange behavior including aborts due to parts of it using some slightly hacky code, the event refactor changing how events are processed and a minor oversight.
Diffstat (limited to 'src/network/clientpackethandler.cpp')
-rw-r--r--src/network/clientpackethandler.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp
index db3655875..aa4d8c244 100644
--- a/src/network/clientpackethandler.cpp
+++ b/src/network/clientpackethandler.cpp
@@ -1062,12 +1062,10 @@ void Client::handleCommand_HudAdd(NetworkPacket* pkt)
try {
*pkt >> size;
} catch(SerializationError &e) {};
- u32 client_id = getEnv().getLocalPlayer()->getFreeHudID();
- m_hud_server_to_client[server_id] = client_id;
ClientEvent *event = new ClientEvent();
event->type = CE_HUDADD;
- event->hudadd.id = client_id;
+ event->hudadd.server_id = server_id;
event->hudadd.type = type;
event->hudadd.pos = new v2f(pos);
event->hudadd.name = new std::string(name);
@@ -1089,7 +1087,7 @@ void Client::handleCommand_HudRemove(NetworkPacket* pkt)
*pkt >> server_id;
- std::unordered_map<u32, u32>::const_iterator i = m_hud_server_to_client.find(server_id);
+ auto i = m_hud_server_to_client.find(server_id);
if (i != m_hud_server_to_client.end()) {
int client_id = i->second;
m_hud_server_to_client.erase(i);