mirror of
https://github.com/EQEmu/Server.git
synced 2026-11-22 20:17:16 +00:00
[Fix] Zone state edge case with 0 hp (#4787)
This commit is contained in:
1 parent
799609fb21
commit
a05d0752f6
1 file changed
+10
@@ -336,6 +336,16 @@ inline void LoadNPCState(Zone *zone, NPC *n, ZoneStateSpawnsRepository::ZoneStat
|
||||
n->SetEndurance(s.endurance);
|
||||
}
|
||||
|
||||
// if these are zero for some reason, we need to reset the max hp
|
||||
if (!s.is_corpse) {
|
||||
if (s.hp == 0 || n->GetHP() == 0) {
|
||||
n->SetMaxHP();
|
||||
}
|
||||
if (s.mana == 0 || n->GetMana() == 0) {
|
||||
n->RestoreMana();
|
||||
}
|
||||
}
|
||||
|
||||
if (s.grid) {
|
||||
n->AssignWaypoints(s.grid, s.current_waypoint);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user