diff --git a/zone/attack.cpp b/zone/attack.cpp index fac1301e5..5b2bc8a19 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -3739,7 +3739,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const //send an HP update if we are hurt if (GetHP() < GetMaxHP()) - SendHPUpdate(!iBuffTic); // the OP_Damage actually updates the client in these cases, so we skip the HP update for them + SendHPUpdate(); // the OP_Damage actually updates the client in these cases, so we skip the HP update for them } //end `if damage was done` //send damage packet... diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index a1eea7154..b415b6938 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -337,9 +337,6 @@ int32 Client::CalcMaxHP() } } - // hack fix for client health not reflecting server value - last_max_hp = 0; - return max_hp; } diff --git a/zone/mob.cpp b/zone/mob.cpp index e46aba587..287bdad92 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -190,7 +190,6 @@ Mob::Mob( last_hp_percent = 0; last_hp = 0; - last_max_hp = 0; current_speed = base_runspeed; @@ -1355,32 +1354,22 @@ void Mob::CreateHPPacket(EQApplicationPacket* app) } } -void Mob::SendHPUpdate(bool skip_self /*= false*/, bool force_update_all /*= false*/) +void Mob::SendHPUpdate(bool force_update_all) { // If our HP is different from last HP update call - let's update selves if (IsClient()) { - - // delay allowing the client to catch up on buff states - if (max_hp != last_max_hp) { - last_max_hp = max_hp; - return; - } - if (current_hp != last_hp || force_update_all) { - // This is to prevent excessive packet sending under trains/fast combat LogHPUpdate( - "[SendHPUpdate] Update HP of self [{}] HP: [{}/{}] last: [{}/{}] skip_self: [{}]", + "[SendHPUpdate] Update HP of self [{}] current_hp [{}] max_hp [{}] last_hp [{}]", GetCleanName(), current_hp, max_hp, - last_hp, - last_max_hp, - (skip_self ? "true" : "false") + last_hp ); - if (!skip_self || this->CastToClient()->ClientVersion() >= EQ::versions::ClientVersion::SoD) { + if (CastToClient()->ClientVersion() >= EQ::versions::ClientVersion::SoD) { auto client_packet = new EQApplicationPacket(OP_HPUpdate, sizeof(SpawnHPUpdate_Struct)); auto *hp_packet_client = (SpawnHPUpdate_Struct *) client_packet->pBuffer; @@ -3279,7 +3268,7 @@ void Mob::SetTarget(Mob *mob) } if (IsClient() && GetTarget()) { - GetTarget()->SendHPUpdate(false, true); + GetTarget()->SendHPUpdate(true); } } diff --git a/zone/mob.h b/zone/mob.h index 339bd1ce0..53170b958 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -680,7 +680,7 @@ public: static void CreateSpawnPacket(EQApplicationPacket* app, NewSpawn_Struct* ns); virtual void FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho); void CreateHPPacket(EQApplicationPacket* app); - void SendHPUpdate(bool skip_self = false, bool force_update_all = false); + void SendHPUpdate(bool force_update_all = false); virtual void ResetHPUpdateTimer() {}; // does nothing //Util