diff options
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/inventoryhandler.h | 22 | ||||
-rw-r--r-- | src/net/tmwa/loginhandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/messageout.cpp | 7 | ||||
-rw-r--r-- | src/net/tmwa/messageout.h | 6 | ||||
-rw-r--r-- | src/net/tmwa/network.cpp | 2 |
5 files changed, 14 insertions, 25 deletions
diff --git a/src/net/tmwa/inventoryhandler.h b/src/net/tmwa/inventoryhandler.h index 6224b572..6bf11f54 100644 --- a/src/net/tmwa/inventoryhandler.h +++ b/src/net/tmwa/inventoryhandler.h @@ -136,18 +136,6 @@ class EquipBackend : public Equipment::Backend int getSlotNumber() const override { return EQUIP_VECTOR_END; } - // Note the slot type id is equal to the slot Index for tA. - bool isWeaponSlot(unsigned int slotTypeId) const - { - return (slotTypeId == EQUIP_FIGHT1_SLOT - || slotTypeId == EQUIP_FIGHT1_SLOT); - } - - bool isAmmoSlot(unsigned int slotTypeId) const - { - return (slotTypeId == EQUIP_PROJECTILE_SLOT); - } - private: int mEquipment[EQUIP_VECTOR_END]; }; @@ -195,11 +183,17 @@ class InventoryHandler : public MessageHandler, public Net::InventoryHandler, size_t getSize(int type) const override; + // Note the slot type id is equal to the slot Index for tA. bool isWeaponSlot(unsigned int slotTypeId) const override - { return mEquips.isWeaponSlot(slotTypeId); } + { + return (slotTypeId == EQUIP_FIGHT1_SLOT + || slotTypeId == EQUIP_FIGHT1_SLOT); + } bool isAmmoSlot(unsigned int slotTypeId) const override - { return mEquips.isAmmoSlot(slotTypeId); } + { + return (slotTypeId == EQUIP_PROJECTILE_SLOT); + } private: EquipBackend mEquips; diff --git a/src/net/tmwa/loginhandler.h b/src/net/tmwa/loginhandler.h index 92a268f1..3ff33e83 100644 --- a/src/net/tmwa/loginhandler.h +++ b/src/net/tmwa/loginhandler.h @@ -29,7 +29,7 @@ #include <string> -struct LoginData; +class LoginData; namespace TmwAthena { diff --git a/src/net/tmwa/messageout.cpp b/src/net/tmwa/messageout.cpp index ae5f6dba..19f5ee49 100644 --- a/src/net/tmwa/messageout.cpp +++ b/src/net/tmwa/messageout.cpp @@ -31,12 +31,9 @@ namespace TmwAthena { MessageOut::MessageOut(uint16_t id): - mDataSize(0), - mPos(0) + mNetwork(TmwAthena::Network::instance()), + mData(mNetwork->mOutBuffer + mNetwork->mOutSize) { - mNetwork = TmwAthena::Network::instance(); - mData = mNetwork->mOutBuffer + mNetwork->mOutSize; - writeInt16(id); } diff --git a/src/net/tmwa/messageout.h b/src/net/tmwa/messageout.h index dd2b84cc..4f1faa9d 100644 --- a/src/net/tmwa/messageout.h +++ b/src/net/tmwa/messageout.h @@ -88,9 +88,9 @@ class MessageOut Network *mNetwork; - char *mData; /**< Data building up. */ - unsigned int mDataSize; /**< Size of data. */ - unsigned int mPos; /**< Position in the data. */ + char *mData; /**< Data building up. */ + unsigned int mDataSize = 0; /**< Size of data. */ + unsigned int mPos = 0; /**< Position in the data. */ }; } // namespace TmwAthena diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp index c1862f00..f5aeaf91 100644 --- a/src/net/tmwa/network.cpp +++ b/src/net/tmwa/network.cpp @@ -23,8 +23,6 @@ #include "log.h" -#include "net/messagehandler.h" - #include "net/tmwa/messagein.h" #include "net/tmwa/protocol.h" |