[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
This commit is contained in:
KayenEQ 2024-04-02 02:13:29 -04:00 committed by GitHub
parent e9a0c79301
commit 043eeced6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;