diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/manaserv/manaserv_protocol.h | 2 | ||||
-rw-r--r-- | src/net/messagein.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/beinghandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/inventoryhandler.cpp | 7 | ||||
-rw-r--r-- | src/net/tmwa/inventoryhandler.h | 21 |
6 files changed, 13 insertions, 23 deletions
diff --git a/src/net/manaserv/manaserv_protocol.h b/src/net/manaserv/manaserv_protocol.h index ca9a0f02..180e9810 100644 --- a/src/net/manaserv/manaserv_protocol.h +++ b/src/net/manaserv/manaserv_protocol.h @@ -438,6 +438,6 @@ enum SpriteLayer SPRITE_VECTOREND }; -}; // Namespace ManaServ +} // namespace ManaServ #endif // MANASERV_PROTOCOL_H diff --git a/src/net/messagein.h b/src/net/messagein.h index 29f5e930..726c3bab 100644 --- a/src/net/messagein.h +++ b/src/net/messagein.h @@ -103,6 +103,6 @@ class MessageIn unsigned int mPos; }; -} +} // namespace Net #endif // NET_MESSAGEIN_H diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index b7cf7bd9..7adb6ed7 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -78,7 +78,7 @@ BeingHandler::BeingHandler(bool enableSync): handledMessages = _messages; } -Being *createBeing(int id, short job) +static Being *createBeing(int id, short job) { ActorSprite::Type type = ActorSprite::UNKNOWN; if (job <= 25 || (job >= 4001 && job <= 4049)) diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h index a4725b89..3698c6d3 100644 --- a/src/net/tmwa/generalhandler.h +++ b/src/net/tmwa/generalhandler.h @@ -73,4 +73,4 @@ class GeneralHandler : public MessageHandler, public Net::GeneralHandler, } // namespace TmwAthena -#endif // NET_TA_GENERALHANDLER_H +#endif // NET_TMWA_GENERALHANDLER_H diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index edb5e53f..48f40e11 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -49,7 +49,7 @@ extern Net::InventoryHandler *inventoryHandler; namespace TmwAthena { -const EquipmentSlot EQUIP_POINTS[EQUIP_VECTOR_END] = { +static const EquipmentSlot EQUIP_POINTS[EQUIP_VECTOR_END] = { EQUIP_LEGS_SLOT, EQUIP_FIGHT1_SLOT, EQUIP_ARMS_SLOT, @@ -60,9 +60,10 @@ const EquipmentSlot EQUIP_POINTS[EQUIP_VECTOR_END] = { EQUIP_NECKLACE_SLOT, EQUIP_HEAD_SLOT, EQUIP_TORSO_SLOT, - EQUIP_PROJECTILE_SLOT}; + EQUIP_PROJECTILE_SLOT +}; -int getSlot(int eAthenaSlot) +static int getSlot(int eAthenaSlot) { if (eAthenaSlot == 0) { diff --git a/src/net/tmwa/inventoryhandler.h b/src/net/tmwa/inventoryhandler.h index 315be16c..218723e6 100644 --- a/src/net/tmwa/inventoryhandler.h +++ b/src/net/tmwa/inventoryhandler.h @@ -49,10 +49,6 @@ class EquipBackend : public Equipment::Backend Item *getEquipment(int index) const { int invyIndex = mEquipment[index]; - if (invyIndex == -1) - { - return NULL; - } return PlayerInfo::getInventory()->getItem(invyIndex); } @@ -62,11 +58,8 @@ class EquipBackend : public Equipment::Backend { if (mEquipment[i] != -1) { - Item* item = PlayerInfo::getInventory()->getItem(i); - if (item) - { + if (Item *item = PlayerInfo::getInventory()->getItem(i)) item->setEquipped(false); - } } mEquipment[i] = -1; @@ -75,20 +68,16 @@ class EquipBackend : public Equipment::Backend void setEquipment(int index, int inventoryIndex) { + Inventory *inventory = PlayerInfo::getInventory(); + // Unequip existing item - Item* item = PlayerInfo::getInventory()->getItem(mEquipment[index]); - if (item) - { + if (Item *item = inventory->getItem(mEquipment[index])) item->setEquipped(false); - } mEquipment[index] = inventoryIndex; - item = PlayerInfo::getInventory()->getItem(inventoryIndex); - if (item) - { + if (Item *item = inventory->getItem(inventoryIndex)) item->setEquipped(true); - } inventoryWindow->updateButtons(); } |