summaryrefslogtreecommitdiff
path: root/src/net/tmwa/beinghandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa/beinghandler.cpp')
-rw-r--r--src/net/tmwa/beinghandler.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index b66ad64be..0687c8e17 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -183,24 +183,9 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
case SMSG_PLAYER_UPDATE_1:
case SMSG_PLAYER_UPDATE_2:
case SMSG_PLAYER_MOVE:
- int type;
- switch (msg.getId())
- {
- case SMSG_PLAYER_UPDATE_1:
- type = 1;
- break;
- case SMSG_PLAYER_UPDATE_2:
- type = 2;
- break;
- case SMSG_PLAYER_MOVE:
- type = 3;
- break;
- default:
- return;
- }
- processPlayerMoveUpdate(msg, type);
-
+ processPlayerMoveUpdate(msg);
break;
+
case SMSG_PLAYER_STOP:
processPlayerStop(msg);
break;
@@ -453,8 +438,7 @@ void BeingHandler::processNameResponse2(Net::MessageIn &msg)
BLOCK_END("BeingHandler::processNameResponse2")
}
-void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
- const int msgType) const
+void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg) const
{
BLOCK_START("BeingHandler::processPlayerMoveUpdate")
if (!actorManager || !localPlayer)
@@ -463,6 +447,22 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
return;
}
+ int msgType;
+ switch (msg.getId())
+ {
+ case SMSG_PLAYER_UPDATE_1:
+ msgType = 1;
+ break;
+ case SMSG_PLAYER_UPDATE_2:
+ msgType = 2;
+ break;
+ case SMSG_PLAYER_MOVE:
+ msgType = 3;
+ break;
+ default:
+ return;
+ }
+
// An update about a player, potentially including movement.
const int id = msg.readInt32();
const int16_t speed = msg.readInt16();