From 3a270dd96abbe9fd2ccd3a3e5bdfbcaf0de52712 Mon Sep 17 00:00:00 2001 From: Uleat Date: Fri, 3 Oct 2014 15:05:20 -0400 Subject: [PATCH] Moved OP_LootItem slot translation to external handlers in client patch files --- changelog.txt | 1 + common/patches/client62.cpp | 6 ++++-- common/patches/rof.cpp | 6 ++++-- common/patches/sod.cpp | 6 ++++-- common/patches/sof.cpp | 6 ++++-- common/patches/titanium.cpp | 6 ++++-- common/patches/underfoot.cpp | 6 ++++-- 7 files changed, 25 insertions(+), 12 deletions(-) diff --git a/changelog.txt b/changelog.txt index b31afa449..6272d4a69 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 10/03/2014 == Uleat: Fixed Ti(6.2) OP_AugmentInfo translation that I broke (does not currently need and I mis-read a process) +Uleat: Moved client patch OP_LootItem slot translation to external handlers == 10/02/2014 == Uleat: First round of Ti/6.2 translators added - needed for re-enumeration diff --git a/common/patches/client62.cpp b/common/patches/client62.cpp index d9def3dbb..2da492145 100644 --- a/common/patches/client62.cpp +++ b/common/patches/client62.cpp @@ -446,7 +446,7 @@ namespace Client62 OUT(lootee); OUT(looter); - eq->slot_id = emu->slot_id; + eq->slot_id = ServerToClient62CorpseSlot(emu->slot_id); OUT(auto_loot); FINISH_ENCODE(); @@ -1105,7 +1105,7 @@ namespace Client62 IN(lootee); IN(looter); - emu->slot_id = eq->slot_id; + emu->slot_id = Client62ToServerCorpseSlot(eq->slot_id); IN(auto_loot); FINISH_DIRECT_DECODE(); @@ -1317,6 +1317,7 @@ namespace Client62 static inline int16 ServerToClient62CorpseSlot(uint32 ServerCorpse) { //int16 Client62Corpse; + return ServerCorpse; } static inline uint32 Client62ToServerSlot(int16 Client62Slot) @@ -1331,6 +1332,7 @@ namespace Client62 static inline uint32 Client62ToServerCorpseSlot(int16 Client62Corpse) { //uint32 ServerCorpse; + return Client62Corpse; } } // end namespace Client62 diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 581858381..d6eb858e3 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -1423,7 +1423,7 @@ namespace RoF OUT(lootee); OUT(looter); - eq->slot_id = emu->slot_id + 1; + eq->slot_id = ServerToRoFCorpseSlot(emu->slot_id); OUT(auto_loot); FINISH_ENCODE(); @@ -4405,7 +4405,7 @@ namespace RoF IN(lootee); IN(looter); - emu->slot_id = eq->slot_id - 1; + emu->slot_id = RoFToServerCorpseSlot(eq->slot_id); IN(auto_loot); FINISH_DIRECT_DECODE(); @@ -5406,6 +5406,7 @@ namespace RoF static inline uint32 ServerToRoFCorpseSlot(uint32 ServerCorpse) { //uint32 RoFCorpse; + return (ServerCorpse + 1); } static inline uint32 RoFToServerSlot(structs::ItemSlotStruct RoFSlot) @@ -5546,6 +5547,7 @@ namespace RoF static inline uint32 RoFToServerCorpseSlot(uint32 RoFCorpse) { //uint32 ServerCorpse; + return (RoFCorpse - 1); } } // end namespace RoF diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 90c5644fe..3501e73f0 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -984,7 +984,7 @@ namespace SoD OUT(lootee); OUT(looter); - eq->slot_id = emu->slot_id + 1; + eq->slot_id = ServerToSoDCorpseSlot(emu->slot_id); OUT(auto_loot); FINISH_ENCODE(); @@ -2956,7 +2956,7 @@ namespace SoD IN(lootee); IN(looter); - emu->slot_id = eq->slot_id - 1; + emu->slot_id = SoDToServerCorpseSlot(eq->slot_id); IN(auto_loot); FINISH_DIRECT_DECODE(); @@ -3599,6 +3599,7 @@ namespace SoD static inline uint32 ServerToSoDCorpseSlot(uint32 ServerCorpse) { //uint32 SoDCorpse; + return (ServerCorpse + 1); } static inline uint32 SoDToServerSlot(uint32 SoDSlot) @@ -3623,6 +3624,7 @@ namespace SoD static inline uint32 SoDToServerCorpseSlot(uint32 SoDCorpse) { //uint32 ServerCorpse; + return (SoDCorpse - 1); } } // end namespace SoD diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 861edcb3d..80c0cb7cf 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -783,7 +783,7 @@ namespace SoF OUT(lootee); OUT(looter); - eq->slot_id = emu->slot_id + 1; + eq->slot_id = ServerToSoFCorpseSlot(emu->slot_id); OUT(auto_loot); FINISH_ENCODE(); @@ -2294,7 +2294,7 @@ namespace SoF IN(lootee); IN(looter); - emu->slot_id = eq->slot_id - 1; + emu->slot_id = SoFToServerCorpseSlot(eq->slot_id); IN(auto_loot); FINISH_DIRECT_DECODE(); @@ -2920,6 +2920,7 @@ namespace SoF static inline uint32 ServerToSoFCorpseSlot(uint32 ServerCorpse) { //uint32 SoFCorpse; + return (ServerCorpse + 1); } static inline uint32 SoFToServerSlot(uint32 SoFSlot) @@ -2945,6 +2946,7 @@ namespace SoF static inline uint32 SoFToServerCorpseSlot(uint32 SoFCorpse) { //uint32 ServerCorpse; + return (SoFCorpse - 1); } } // end namespace SoF diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index d0235049d..7c990751d 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -654,7 +654,7 @@ namespace Titanium OUT(lootee); OUT(looter); - eq->slot_id = emu->slot_id; + eq->slot_id = ServerToTitaniumCorpseSlot(emu->slot_id); OUT(auto_loot); FINISH_ENCODE(); @@ -1517,7 +1517,7 @@ namespace Titanium IN(lootee); IN(looter); - emu->slot_id = eq->slot_id; + emu->slot_id = TitaniumToServerCorpseSlot(eq->slot_id); IN(auto_loot); FINISH_DIRECT_DECODE(); @@ -1745,6 +1745,7 @@ namespace Titanium static inline int16 ServerToTitaniumCorpseSlot(uint32 ServerCorpse) { //int16 TitaniumCorpse; + return ServerCorpse; } static inline uint32 TitaniumToServerSlot(int16 TitaniumSlot) @@ -1759,6 +1760,7 @@ namespace Titanium static inline uint32 TitaniumToServerCorpseSlot(int16 TitaniumCorpse) { //uint32 ServerCorpse; + return TitaniumCorpse; } } // end namespace Titanium diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index 0cec336b2..7c1aa940b 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -1234,7 +1234,7 @@ namespace Underfoot OUT(lootee); OUT(looter); - eq->slot_id = emu->slot_id + 1; + eq->slot_id = ServerToUnderFootCorpseSlot(emu->slot_id); OUT(auto_loot); FINISH_ENCODE(); @@ -3294,7 +3294,7 @@ namespace Underfoot IN(lootee); IN(looter); - emu->slot_id = eq->slot_id - 1; + emu->slot_id = UnderfootToServerCorpseSlot(eq->slot_id); IN(auto_loot); FINISH_DIRECT_DECODE(); @@ -4021,6 +4021,7 @@ namespace Underfoot static inline uint32 ServerToUnderFootCorpseSlot(uint32 ServerCorpse) { //uint32 UnderfootCorpse; + return (ServerCorpse + 1); } static inline uint32 UnderfootToServerSlot(uint32 UnderfootSlot) @@ -4046,6 +4047,7 @@ namespace Underfoot static inline uint32 UnderfootToServerCorpseSlot(uint32 UnderfootCorpse) { //uint32 ServerCorpse; + return (UnderfootCorpse - 1); } } // end namespace Underfoot