From 55d2e9b8429e86553bed1d62a05ed32446538a9c Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Wed, 24 Aug 2016 23:15:31 -0400 Subject: [PATCH] Only correct spell slots when we're sending to self This will fix display issues with lots of buffs on NPCs --- common/patches/rof.cpp | 9 +++++---- common/patches/rof2.cpp | 17 ++++++++--------- common/patches/uf.cpp | 12 +++++------- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 939ad03fa..7c5f302cb 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -477,10 +477,11 @@ namespace RoF for (uint16 i = 0; i < emu->count; ++i) { uint16 buffslot = emu->entries[i].buff_slot; - // Not sure if this is needs amending for RoF yet. - if (emu->entries[i].buff_slot >= 25) - { - buffslot += 17; + if (emu->type == 0) { // only correct for self packets + if (emu->entries[i].buff_slot >= 25) + buffslot += 17; + if (buffslot == 54) + buffslot = 62; } __packet->WriteUInt32(buffslot); diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 118419f48..5bb93f14a 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -549,16 +549,15 @@ namespace RoF2 for (uint16 i = 0; i < emu->count; ++i) { uint16 buffslot = emu->entries[i].buff_slot; - // Not sure if this is needs amending for RoF2 yet. - if (emu->entries[i].buff_slot >= 25) - { - buffslot += 17; + if (emu->type == 0) { // only correct for self packets + if (emu->entries[i].buff_slot >= 25) + buffslot += 17; + // TODO: We should really just deal with these "server side" + // so we can have clients not limited to other clients. + // This fixes discs, songs were changed to 20 + if (buffslot == 54) + buffslot = 62; } - // TODO: We should really just deal with these "server side" - // so we can have clients not limited to other clients. - // This fixes discs, songs were changed to 20 - if (buffslot == 54) - buffslot = 62; __packet->WriteUInt32(buffslot); __packet->WriteUInt32(emu->entries[i].spell_id); diff --git a/common/patches/uf.cpp b/common/patches/uf.cpp index 6a1a03a09..af81fea06 100644 --- a/common/patches/uf.cpp +++ b/common/patches/uf.cpp @@ -410,13 +410,11 @@ namespace UF for (uint16 i = 0; i < emu->count; ++i) { uint16 buffslot = emu->entries[i].buff_slot; - if (emu->entries[i].buff_slot >= 25 && emu->entries[i].buff_slot < 37) - { - buffslot += 5; - } - else if (emu->entries[i].buff_slot >= 37) - { - buffslot += 14; + if (emu->type == 0) { // only correct for self packets + if (emu->entries[i].buff_slot >= 25 && emu->entries[i].buff_slot < 37) + buffslot += 5; + else if (emu->entries[i].buff_slot >= 37) + buffslot += 14; } __packet->WriteUInt32(buffslot);