Merge pull request #1178 from hgtw/fix/spawn-condition-crash

[Bugfix] Fix zone crash on spawn condition change
This commit is contained in:
Chris Miles 2021-01-21 18:22:27 -06:00 committed by GitHub
commit f1920f2132
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
}
}
}