diff options
author | Chuck Miller <shadowmil@gmail.com> | 2010-11-11 23:12:29 -0500 |
---|---|---|
committer | Chuck Miller <shadowmil@gmail.com> | 2010-11-11 23:12:29 -0500 |
commit | a4640305fd0d88c6332112712aa69e496368e01b (patch) | |
tree | 0f039b331026ca2b9718a920b24e2344f9e56b25 /src/net/tmwa/inventoryhandler.cpp | |
parent | 5727a2d9eeb0688a16e5b7fe32f6d9836c4f7a4e (diff) | |
download | mana-a4640305fd0d88c6332112712aa69e496368e01b.tar.gz mana-a4640305fd0d88c6332112712aa69e496368e01b.tar.bz2 mana-a4640305fd0d88c6332112712aa69e496368e01b.tar.xz mana-a4640305fd0d88c6332112712aa69e496368e01b.zip |
Replace Event names with enums instead of strings
Diffstat (limited to 'src/net/tmwa/inventoryhandler.cpp')
-rw-r--r-- | src/net/tmwa/inventoryhandler.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index ae79ab09..3a0a93e3 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -435,7 +435,7 @@ void InventoryHandler::event(Channels channel, { if (channel == CHANNEL_ITEM) { - if (event.getName() == "doCloseInventory") + if (event.getName() == EVENT_DOCLOSEINVENTORY) { // No need to worry about type MessageOut outMsg(CMSG_CLOSE_STORAGE); @@ -449,24 +449,24 @@ void InventoryHandler::event(Channels channel, int index = item->getInvIndex() + INVENTORY_OFFSET; - if (event.getName() == "doEquip") + if (event.getName() == EVENT_DOEQUIP) { MessageOut outMsg(CMSG_PLAYER_EQUIP); outMsg.writeInt16(index); outMsg.writeInt16(0); } - else if (event.getName() == "doUnequip") + else if (event.getName() == EVENT_DOUNEQUIP) { MessageOut outMsg(CMSG_PLAYER_UNEQUIP); outMsg.writeInt16(index); } - else if (event.getName() == "doUse") + else if (event.getName() == EVENT_DOUSE) { MessageOut outMsg(CMSG_PLAYER_INVENTORY_USE); outMsg.writeInt16(index); outMsg.writeInt32(item->getId()); // unused } - else if (event.getName() == "doDrop") + else if (event.getName() == EVENT_DODROP) { int amount = event.getInt("amount", 1); @@ -476,7 +476,7 @@ void InventoryHandler::event(Channels channel, outMsg.writeInt16(index); outMsg.writeInt16(amount); } - else if (event.getName() == "doMove") + else if (event.getName() == EVENT_DOMOVE) { int newIndex = event.getInt("newIndex", -1); |