From eaabc5681eb0f7586edde90b655658985059b5fc Mon Sep 17 00:00:00 2001 From: sorcerer-merlin Date: Sun, 15 Nov 2026 17:10:09 -0500 Subject: [PATCH] fix(view): never show a living creature at 0 health GetViewPool scales health to the viewer's effective level and rounds down, so a creature at 1 HP (142 real, 84 shown) was sent as 0. The client treats health 0 as death (OnDeath), so it played the death animation while the server kept the creature alive and fighting. --- src/ZoneScalingCombat.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ZoneScalingCombat.cpp b/src/ZoneScalingCombat.cpp index a2a9a56..fd93f86 100644 --- a/src/ZoneScalingCombat.cpp +++ b/src/ZoneScalingCombat.cpp @@ -231,6 +231,10 @@ bool ZoneScalingMgr::GetViewPool(Creature const* creature, uint8 effective, View uint32 const realMax = std::max(creature->GetMaxHealth(), 1); out.MaxHealth = std::max(1, uint32(uint64(realMax) * stats.Health / state->CanonicalStats.Health)); out.Health = uint32(uint64(creature->GetHealth()) * out.MaxHealth / realMax); + // Never show a creature with health left at 0: the client treats health 0 as death (CGUnit_C::OnDeath), so a + // mob held at 1 HP by an invincibility floor (142 real, 84 shown -> 0) played its death and slid home as a corpse. + if (!out.Health && creature->GetHealth()) + out.Health = 1; out.MaxMana = out.Mana = 0; uint32 const realMaxMana = creature->GetMaxPower(POWER_MANA);