summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-07-08 20:42:40 +0300
committerAndrei Karas <akaras@inbox.ru>2011-07-08 20:42:40 +0300
commit1fcd75140b847a0e50584fc07fc47d90c9dd9fa8 (patch)
tree5c1b23c7eabc7d421f46d40ab0bf787ef7dac49b /src/net/tmwa
parent53bc0b25c23f8f24d4119ae6fb5ba6ca0a91be19 (diff)
downloadplus-1fcd75140b847a0e50584fc07fc47d90c9dd9fa8.tar.gz
plus-1fcd75140b847a0e50584fc07fc47d90c9dd9fa8.tar.bz2
plus-1fcd75140b847a0e50584fc07fc47d90c9dd9fa8.tar.xz
plus-1fcd75140b847a0e50584fc07fc47d90c9dd9fa8.zip
Add small optimisations and fixes.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/inventoryhandler.cpp4
-rw-r--r--src/net/tmwa/inventoryhandler.h4
-rw-r--r--src/net/tmwa/partyhandler.cpp2
-rw-r--r--src/net/tmwa/partyhandler.h6
-rw-r--r--src/net/tmwa/playerhandler.cpp8
-rw-r--r--src/net/tmwa/playerhandler.h8
6 files changed, 16 insertions, 16 deletions
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<Sint16>(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<int>(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