mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
Fix zone crash on spawn condition change
The NPC pointer held by Spawn2 wasn't reset if the npc was depopped without a respawn timer by #depop commands or depop(false) quest apis. If the NPC was part of a spawn condition then the condition would try to dereference that pointer (which gets deleted) on condition change.
This commit is contained in:
parent
0f5a7e1317
commit
836210404c
@ -968,9 +968,12 @@ void NPC::Depop(bool StartSpawnTimer) {
|
||||
if(emoteid != 0)
|
||||
this->DoNPCEmote(ONDESPAWN,emoteid);
|
||||
p_depop = true;
|
||||
if (StartSpawnTimer) {
|
||||
if (respawn2 != 0) {
|
||||
if (respawn2)
|
||||
{
|
||||
if (StartSpawnTimer) {
|
||||
respawn2->DeathReset();
|
||||
} else {
|
||||
respawn2->Depop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user