summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-23 15:45:54 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-23 15:45:54 +0300
commita22d7bce703101ba3ae15cb5b8545381dfe863c4 (patch)
tree861b10567276cb6f8e66d6cc4d455c72e7fffbcb
parentbba45d879b84a20e7b6f50aca1297cb3899aafdd (diff)
downloadmv-a22d7bce703101ba3ae15cb5b8545381dfe863c4.tar.gz
mv-a22d7bce703101ba3ae15cb5b8545381dfe863c4.tar.bz2
mv-a22d7bce703101ba3ae15cb5b8545381dfe863c4.tar.xz
mv-a22d7bce703101ba3ae15cb5b8545381dfe863c4.zip
Move server slot to client slot conversion from ea into eathena and tmwa.
-rw-r--r--src/net/ea/eaprotocol.h3
-rw-r--r--src/net/ea/inventoryhandler.cpp28
-rw-r--r--src/net/ea/inventoryhandler.h3
-rw-r--r--src/net/eathena/inventoryhandler.cpp29
-rw-r--r--src/net/eathena/inventoryhandler.h3
-rw-r--r--src/net/eathena/sprite.h2
-rw-r--r--src/net/tmwa/inventoryhandler.cpp27
-rw-r--r--src/net/tmwa/inventoryhandler.h3
8 files changed, 67 insertions, 31 deletions
diff --git a/src/net/ea/eaprotocol.h b/src/net/ea/eaprotocol.h
index c2c5c1970..46677f25a 100644
--- a/src/net/ea/eaprotocol.h
+++ b/src/net/ea/eaprotocol.h
@@ -89,6 +89,9 @@ enum
EA_SPRITE_SHIELD,
EA_SPRITE_EVOL1,
EA_SPRITE_EVOL2,
+ EA_SPRITE_EVOL3,
+ EA_SPRITE_EVOL4,
+ EA_SPRITE_EVOL5,
EA_SPRITE_VECTOREND
};
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index 6c0194bd3..074459841 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -65,26 +65,6 @@ const Equipment::Slot EQUIP_POINTS[Equipment::EQUIP_VECTOREND] =
Equipment::EQUIP_SHADOW_ACCESSORY1_SLOT, // Shadow Accessory 1
};
-// missing EQUIP_RING1_SLOT
-const Equipment::Slot EQUIP_CONVERT[] =
-{
- Equipment::EQUIP_PROJECTILE_SLOT, // 0
- Equipment::EQUIP_FEET_SLOT, // SPRITE_SHOE
- Equipment::EQUIP_LEGS_SLOT, // SPRITE_BOTTOMCLOTHES
- Equipment::EQUIP_TORSO_SLOT, // SPRITE_TOPCLOTHES
- Equipment::EQUIP_PROJECTILE_SLOT, // 0
- Equipment::EQUIP_NECK_SLOT, // SPRITE_RING
- Equipment::EQUIP_PROJECTILE_SLOT, // 0
- Equipment::EQUIP_HEAD_SLOT, // SPRITE_HAT
- Equipment::EQUIP_RING2_SLOT, // 0
- Equipment::EQUIP_GLOVES_SLOT, // SPRITE_GLOVES
- Equipment::EQUIP_FIGHT1_SLOT, // SPRITE_WEAPON
- Equipment::EQUIP_FIGHT2_SLOT, // SPRITE_SHIELD
- Equipment::EQUIP_EVOL_RING1_SLOT, // SPRITE_EVOL1
- Equipment::EQUIP_EVOL_RING2_SLOT, // SPRITE_EVOL2
- Equipment::EQUIP_PROJECTILE_SLOT, // 0
-};
-
namespace Ea
{
@@ -161,14 +141,6 @@ size_t InventoryHandler::getSize(const int type) const
return 0;
}
}
-int InventoryHandler::convertFromServerSlot(const int serverSlot) const
-{
- if (serverSlot < 0 || serverSlot > 13)
- return 0;
-
- return static_cast<int>(EQUIP_CONVERT[serverSlot]);
-}
-
int InventoryHandler::getSlot(const int eAthenaSlot)
{
if (eAthenaSlot == 0)
diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h
index f82cf5780..734e894f0 100644
--- a/src/net/ea/inventoryhandler.h
+++ b/src/net/ea/inventoryhandler.h
@@ -73,9 +73,6 @@ class InventoryHandler notfinal : public Net::InventoryHandler
size_t getSize(const int type) const override final A_WARN_UNUSED;
- int convertFromServerSlot(const int serverSlot)
- const override final A_WARN_UNUSED;
-
void pushPickup(const int floorId)
{ mSentPickups.push(floorId); }
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp
index b55aea477..af08fa1b2 100644
--- a/src/net/eathena/inventoryhandler.cpp
+++ b/src/net/eathena/inventoryhandler.cpp
@@ -41,6 +41,27 @@
extern Net::InventoryHandler *inventoryHandler;
+// missing EQUIP_RING1_SLOT
+const Equipment::Slot EQUIP_CONVERT[] =
+{
+ Equipment::EQUIP_PROJECTILE_SLOT, // 0 0
+ Equipment::EQUIP_FEET_SLOT, // 1 SPRITE_SHOE
+ Equipment::EQUIP_LEGS_SLOT, // 2 SPRITE_BOTTOMCLOTHES
+ Equipment::EQUIP_TORSO_SLOT, // 3 SPRITE_TOPCLOTHES
+ Equipment::EQUIP_GLOVES_SLOT, // 4 0
+ Equipment::EQUIP_EVOL_RING1_SLOT, // 5
+ Equipment::EQUIP_PROJECTILE_SLOT, // 6 0
+ Equipment::EQUIP_HEAD_SLOT, // 7 SPRITE_HAT
+ Equipment::EQUIP_RING2_SLOT, // 8 0
+ Equipment::EQUIP_PROJECTILE_SLOT, // 9 SPRITE_GLOVES
+ Equipment::EQUIP_FIGHT1_SLOT, // 10 SPRITE_WEAPON
+ Equipment::EQUIP_FIGHT2_SLOT, // 11 SPRITE_SHIELD
+ Equipment::EQUIP_EVOL_RING2_SLOT, // 12
+ Equipment::EQUIP_EVOL_RING2_SLOT, // 13 SPRITE_EVOL2
+ Equipment::EQUIP_COSTUME_ROBE_SLOT, // 14 SPRITE_EVOL3
+ Equipment::EQUIP_MISSING1_SLOT, // 15 SPRITE_EVOL4
+};
+
namespace EAthena
{
@@ -677,4 +698,12 @@ void InventoryHandler::processPlayerItemRentalExpired(Net::MessageIn &msg)
msg.readInt16("item id");
}
+int InventoryHandler::convertFromServerSlot(const int serverSlot) const
+{
+ if (serverSlot < 0 || serverSlot > 15)
+ return 0;
+
+ return static_cast<int>(EQUIP_CONVERT[serverSlot]);
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/inventoryhandler.h b/src/net/eathena/inventoryhandler.h
index 0b9a70237..272d3a82b 100644
--- a/src/net/eathena/inventoryhandler.h
+++ b/src/net/eathena/inventoryhandler.h
@@ -68,6 +68,9 @@ class InventoryHandler final : public MessageHandler,
void selectEgg(const Item *const item) const override final;
+ int convertFromServerSlot(const int serverSlot)
+ const override final A_WARN_UNUSED;
+
protected:
static void processPlayerEquipment(Net::MessageIn &msg);
diff --git a/src/net/eathena/sprite.h b/src/net/eathena/sprite.h
index 65bba131c..7d685b988 100644
--- a/src/net/eathena/sprite.h
+++ b/src/net/eathena/sprite.h
@@ -39,6 +39,8 @@ enum
SPRITE_SHIELD,
SPRITE_EVOL1,
SPRITE_EVOL2,
+ SPRITE_EVOL3,
+ SPRITE_EVOL4,
SPRITE_VECTOREND
};
diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp
index 83bc38e6a..c271cd95b 100644
--- a/src/net/tmwa/inventoryhandler.cpp
+++ b/src/net/tmwa/inventoryhandler.cpp
@@ -41,6 +41,25 @@
extern Net::InventoryHandler *inventoryHandler;
+// missing EQUIP_RING1_SLOT
+const Equipment::Slot EQUIP_CONVERT[] =
+{
+ Equipment::EQUIP_PROJECTILE_SLOT, // 0 0
+ Equipment::EQUIP_FEET_SLOT, // 1 SPRITE_SHOE
+ Equipment::EQUIP_LEGS_SLOT, // 2 SPRITE_BOTTOMCLOTHES
+ Equipment::EQUIP_TORSO_SLOT, // 3 SPRITE_TOPCLOTHES
+ Equipment::EQUIP_PROJECTILE_SLOT, // 4 0
+ Equipment::EQUIP_NECK_SLOT, // 5 SPRITE_RING
+ Equipment::EQUIP_PROJECTILE_SLOT, // 6 0
+ Equipment::EQUIP_HEAD_SLOT, // 7 SPRITE_HAT
+ Equipment::EQUIP_RING2_SLOT, // 8 0
+ Equipment::EQUIP_GLOVES_SLOT, // 9 SPRITE_GLOVES
+ Equipment::EQUIP_FIGHT1_SLOT, // 10 SPRITE_WEAPON
+ Equipment::EQUIP_FIGHT2_SLOT, // 11 SPRITE_SHIELD
+ Equipment::EQUIP_EVOL_RING1_SLOT, // 12 SPRITE_EVOL1
+ Equipment::EQUIP_EVOL_RING2_SLOT, // 13 SPRITE_EVOL2
+};
+
namespace TmwAthena
{
@@ -610,4 +629,12 @@ void InventoryHandler::selectEgg(const Item *const item A_UNUSED) const
{
}
+int InventoryHandler::convertFromServerSlot(const int serverSlot) const
+{
+ if (serverSlot < 0 || serverSlot > 13)
+ return 0;
+
+ return static_cast<int>(EQUIP_CONVERT[serverSlot]);
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/inventoryhandler.h b/src/net/tmwa/inventoryhandler.h
index 23b8e0f4b..84f6dd974 100644
--- a/src/net/tmwa/inventoryhandler.h
+++ b/src/net/tmwa/inventoryhandler.h
@@ -68,6 +68,9 @@ class InventoryHandler final : public MessageHandler,
void selectEgg(const Item *const item) const override final;
+ int convertFromServerSlot(const int serverSlot)
+ const override final A_WARN_UNUSED;
+
protected:
static void processPlayerEquipment(Net::MessageIn &msg);