diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-08 13:36:05 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-08 13:36:05 +0300 |
commit | f6be620b3f688a4ef4bb3983d9d5fe8afef7f013 (patch) | |
tree | cc9de4463215012cb330071ae9e0cbda3c3f22a2 /src/net/tmwa/npchandler.cpp | |
parent | ecd14ef02d48407b33a8a32505165f99885d801a (diff) | |
download | manaverse-f6be620b3f688a4ef4bb3983d9d5fe8afef7f013.tar.gz manaverse-f6be620b3f688a4ef4bb3983d9d5fe8afef7f013.tar.bz2 manaverse-f6be620b3f688a4ef4bb3983d9d5fe8afef7f013.tar.xz manaverse-f6be620b3f688a4ef4bb3983d9d5fe8afef7f013.zip |
Remove additional parameters from most npchandlers.
Diffstat (limited to 'src/net/tmwa/npchandler.cpp')
-rw-r--r-- | src/net/tmwa/npchandler.cpp | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index 3a9ee00a9..4c96eac21 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -45,8 +45,7 @@ namespace TmwAthena NpcHandler::NpcHandler() : MessageHandler(), - Ea::NpcHandler(), - mRequestLang(false) + Ea::NpcHandler() { static const uint16_t _messages[] = { @@ -71,32 +70,22 @@ void NpcHandler::handleMessage(Net::MessageIn &msg) switch (msg.getId()) { case SMSG_NPC_CHOICE: - getNpc(msg); - mRequestLang = false; processNpcChoice(msg); break; case SMSG_NPC_MESSAGE: - getNpc(msg); - mRequestLang = false; processNpcMessage(msg); break; case SMSG_NPC_CLOSE: - getNpc(msg); - mRequestLang = false; processNpcClose(msg); break; case SMSG_NPC_NEXT: - getNpc(msg); - mRequestLang = false; processNpcNext(msg); break; case SMSG_NPC_INT_INPUT: - getNpc(msg); - mRequestLang = false; processNpcIntInput(msg); break; @@ -111,20 +100,12 @@ void NpcHandler::handleMessage(Net::MessageIn &msg) } case SMSG_NPC_COMMAND: - { - const int npcId = getNpc(msg); - mRequestLang = false; - processNpcCommand(msg, npcId); + processNpcCommand(msg); break; - } case SMSG_NPC_CHANGETITLE: - { - const int npcId = getNpc(msg); - mRequestLang = false; - processChangeTitle(msg, npcId); + processChangeTitle(msg); break; - } default: break; @@ -279,8 +260,11 @@ int NpcHandler::getNpc(Net::MessageIn &msg) return npcId; } -void NpcHandler::processNpcCommand(Net::MessageIn &msg, const int npcId) +void NpcHandler::processNpcCommand(Net::MessageIn &msg) { + const int npcId = getNpc(msg); + mRequestLang = false; + const int cmd = msg.readInt16(); switch (cmd) { @@ -368,9 +352,10 @@ void NpcHandler::processLangReuqest(Net::MessageIn &msg A_UNUSED, stringInput(npcId, getLangSimple()); } -void NpcHandler::processChangeTitle(Net::MessageIn &msg, - const int npcId A_UNUSED) const +void NpcHandler::processChangeTitle(Net::MessageIn &msg) { + const int npcId = getNpc(msg); + mRequestLang = false; const std::string str = msg.readString(); if (mDialog) mDialog->setCaption(str); |