diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-29 14:30:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-29 14:30:20 +0300 |
commit | 0f9ec2061c4ad6157c3186f1cab9c4d8558980b5 (patch) | |
tree | 6259593b8436178ad8d981a96a8fd71eab9e04cc /src/net/ea/npchandler.cpp | |
parent | 01773c71a4698c6f01fe70d864f922bda65506cb (diff) | |
download | mv-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.tar.gz mv-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.tar.bz2 mv-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.tar.xz mv-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.zip |
Add strong typed int type BeingId.
Diffstat (limited to 'src/net/ea/npchandler.cpp')
-rw-r--r-- | src/net/ea/npchandler.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/net/ea/npchandler.cpp b/src/net/ea/npchandler.cpp index a88025b7f..bfa3c3f81 100644 --- a/src/net/ea/npchandler.cpp +++ b/src/net/ea/npchandler.cpp @@ -104,7 +104,7 @@ void NpcHandler::processNpcIntInput(Net::MessageIn &msg) void NpcHandler::processNpcStrInput(Net::MessageIn &msg) { // Request for a string - int npcId = npcHandler->getNpc(msg); + BeingId npcId = npcHandler->getNpc(msg); if (mRequestLang) { mRequestLang = false; @@ -118,11 +118,11 @@ void NpcHandler::processNpcStrInput(Net::MessageIn &msg) void NpcHandler::processNpcCommand(Net::MessageIn &msg) { - const int npcId = npcHandler->getNpc(msg); + const BeingId npcId = npcHandler->getNpc(msg); mRequestLang = false; const int cmd = msg.readInt16("cmd"); - const int id = msg.readInt32("id"); + const BeingId id = msg.readBeingId("id"); const int x = msg.readInt16("x"); const int y = msg.readInt16("y"); switch (cmd) @@ -139,7 +139,7 @@ void NpcHandler::processNpcCommand(Net::MessageIn &msg) case 2: if (viewport) { - if (!id) + if (id == BeingId_zero) viewport->moveCameraToPosition(x, y); else viewport->moveCameraToActor(id, x, y); @@ -165,7 +165,7 @@ void NpcHandler::processNpcCommand(Net::MessageIn &msg) case 6: // show avatar if (mDialog) { - mDialog->showAvatar(static_cast<uint16_t>(id)); + mDialog->showAvatar(id); } break; case 7: // set avatar direction @@ -178,7 +178,7 @@ void NpcHandler::processNpcCommand(Net::MessageIn &msg) break; case 8: // set avatar action if (mDialog) - mDialog->setAvatarAction(id); + mDialog->setAvatarAction(toInt(id, int)); break; case 9: // clear npc dialog if (mDialog) @@ -186,7 +186,7 @@ void NpcHandler::processNpcCommand(Net::MessageIn &msg) break; case 10: // send selected item id { - int invSize = id; + int invSize = toInt(id, int); if (!invSize) invSize = 1; if (mDialog) |