From 043eeced6f2a9e67ccf80fd32d08590ec6d556ce Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Tue, 2 Apr 2024 02:13:29 -0400 Subject: [PATCH] [Bug Fix] Client not updating HP bar when an HP Buff with a Heal is applied. (#4237) * [Bug Fix] HP Bar not updating when applying HP Buff with a heal. Bug: When an HP buff with a heal effect is applied for first time, the heal portion of the effect heals the client and updates HPs currently server side, but client side the HP bar does not register it as a heal thus you display as less than full HP. However due to server thinking your healed, you are unable to correct it by healing. Solution: You need to resend the HP update after buff completed and action packet resent. * add SE_MaxHPChange to fix would result in same bug --- zone/spells.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zone/spells.cpp b/zone/spells.cpp index b7b848046..8ae167348 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -4639,6 +4639,16 @@ bool Mob::SpellOnTarget( safe_delete(action_packet); safe_delete(message_packet); + /* + Bug: When an HP buff with a heal effect is applied for first time, the heal portion of the effect heals the client and + updates HPs currently server side, but client side the HP bar does not register it as a heal thus you display as less than full HP. + However due to server thinking your healed, you are unable to correct it by healing. + Solution: You need to resend the HP update after buff completed and action packet resent. + */ + if ((IsEffectInSpell(spell_id, SE_TotalHP) || IsEffectInSpell(spell_id, SE_MaxHPChange)) && (IsEffectInSpell(spell_id, SE_CurrentHPOnce) || IsEffectInSpell(spell_id, SE_CurrentHP))) { + SendHPUpdate(true); + } + LogSpells("Cast of [{}] by [{}] on [{}] complete successfully", spell_id, GetName(), spelltar->GetName()); return true;