From 1fcd75140b847a0e50584fc07fc47d90c9dd9fa8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 8 Jul 2011 20:42:40 +0300 Subject: Add small optimisations and fixes. --- src/net/tmwa/inventoryhandler.cpp | 4 ++-- src/net/tmwa/inventoryhandler.h | 4 ++-- src/net/tmwa/partyhandler.cpp | 2 +- src/net/tmwa/partyhandler.h | 6 +++--- src/net/tmwa/playerhandler.cpp | 8 ++++---- src/net/tmwa/playerhandler.h | 8 ++++---- 6 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src/net/tmwa') diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index 734c8403e..43f04d2dc 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -618,7 +618,7 @@ void InventoryHandler::dropItem(const Item *item, int amount) outMsg.writeInt16(static_cast(amount)); } -bool InventoryHandler::canSplit(const Item *item A_UNUSED) +bool InventoryHandler::canSplit(const Item *item A_UNUSED) const { return false; } @@ -678,7 +678,7 @@ size_t InventoryHandler::getSize(int type) const return 0; } } -int InventoryHandler::convertFromServerSlot(int serverSlot) +int InventoryHandler::convertFromServerSlot(int serverSlot) const { if (serverSlot < 0 || serverSlot > 13) return 0; diff --git a/src/net/tmwa/inventoryhandler.h b/src/net/tmwa/inventoryhandler.h index 5866f9077..f831f7a78 100644 --- a/src/net/tmwa/inventoryhandler.h +++ b/src/net/tmwa/inventoryhandler.h @@ -153,7 +153,7 @@ class InventoryHandler : public MessageHandler, public Net::InventoryHandler void dropItem(const Item *item, int amount); - bool canSplit(const Item *item); + bool canSplit(const Item *item) const; void splitItem(const Item *item, int amount); @@ -168,7 +168,7 @@ class InventoryHandler : public MessageHandler, public Net::InventoryHandler size_t getSize(int type) const; - int convertFromServerSlot(int serverSlot); + int convertFromServerSlot(int serverSlot) const; void pushPickup(int floorId) { mSentPickups.push(floorId); } diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index f057b6f5f..f8e1e4de8 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -544,7 +544,7 @@ void PartyHandler::chat(const std::string &text) outMsg.writeString(text, static_cast(text.length())); } -void PartyHandler::requestPartyMembers() +void PartyHandler::requestPartyMembers() const { // Our eAthena doesn't have this message // Not needed anyways diff --git a/src/net/tmwa/partyhandler.h b/src/net/tmwa/partyhandler.h index b2e08d12d..207bc5f26 100644 --- a/src/net/tmwa/partyhandler.h +++ b/src/net/tmwa/partyhandler.h @@ -64,14 +64,14 @@ class PartyHandler : public MessageHandler, public Net::PartyHandler void chat(const std::string &text); - void requestPartyMembers(); + void requestPartyMembers() const; - PartyShare getShareExperience() + PartyShare getShareExperience() const { return mShareExp; } void setShareExperience(PartyShare share); - PartyShare getShareItems() + PartyShare getShareItems() const { return mShareItems; } void setShareItems(PartyShare share); diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index 62027cdd4..18bed203f 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -759,22 +759,22 @@ void PlayerHandler::ignoreAll(bool ignore A_UNUSED) // TODO } -bool PlayerHandler::canUseMagic() +bool PlayerHandler::canUseMagic() const { return PlayerInfo::getStatEffective(MATK) > 0; } -bool PlayerHandler::canCorrectAttributes() +bool PlayerHandler::canCorrectAttributes() const { return false; } -int PlayerHandler::getJobLocation() +int PlayerHandler::getJobLocation() const { return JOB; } -Vector PlayerHandler::getDefaultWalkSpeed() +Vector PlayerHandler::getDefaultWalkSpeed() const { // Return an normalized speed for any side // as the offset is calculated elsewhere. diff --git a/src/net/tmwa/playerhandler.h b/src/net/tmwa/playerhandler.h index d4e232ecf..fc4230856 100644 --- a/src/net/tmwa/playerhandler.h +++ b/src/net/tmwa/playerhandler.h @@ -62,12 +62,12 @@ class PlayerHandler : public MessageHandler, public Net::PlayerHandler void ignorePlayer(const std::string &player, bool ignore); void ignoreAll(bool ignore); - bool canUseMagic(); - bool canCorrectAttributes(); + bool canUseMagic() const; + bool canCorrectAttributes() const; - int getJobLocation(); + int getJobLocation() const; - Vector getDefaultWalkSpeed(); + Vector getDefaultWalkSpeed() const; }; } // namespace TmwAthena -- cgit v1.2.3-70-g09d2