mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
[Fix] Zone state edge case with 0 hp (#4787)
This commit is contained in:
parent
799609fb21
commit
a05d0752f6
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user