diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-23 15:45:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-23 15:45:54 +0300 |
commit | a22d7bce703101ba3ae15cb5b8545381dfe863c4 (patch) | |
tree | 861b10567276cb6f8e66d6cc4d455c72e7fffbcb /src/net/eathena/inventoryhandler.cpp | |
parent | bba45d879b84a20e7b6f50aca1297cb3899aafdd (diff) | |
download | ManaVerse-a22d7bce703101ba3ae15cb5b8545381dfe863c4.tar.gz ManaVerse-a22d7bce703101ba3ae15cb5b8545381dfe863c4.tar.bz2 ManaVerse-a22d7bce703101ba3ae15cb5b8545381dfe863c4.tar.xz ManaVerse-a22d7bce703101ba3ae15cb5b8545381dfe863c4.zip |
Move server slot to client slot conversion from ea into eathena and tmwa.
Diffstat (limited to 'src/net/eathena/inventoryhandler.cpp')
-rw-r--r-- | src/net/eathena/inventoryhandler.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
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 |