This commit is contained in:
GenZmeY 2023-05-20 17:56:04 +03:00
parent a747c3eaf8
commit b0292d71ce

View File

@ -3,6 +3,11 @@ class ZedSpawnerMut extends KFMutator
var private ZedSpawner ZS; var private ZedSpawner ZS;
public simulated function bool SafeDestroy()
{
return (bPendingDelete || bDeleteMe || Destroy());
}
public event PreBeginPlay() public event PreBeginPlay()
{ {
Super.PreBeginPlay(); Super.PreBeginPlay();
@ -22,7 +27,7 @@ public event PreBeginPlay()
if (ZS == None) if (ZS == None)
{ {
`Log_Base("FATAL: Can't Spawn 'ZedSpawner'"); `Log_Base("FATAL: Can't Spawn 'ZedSpawner'");
Destroy(); SafeDestroy();
} }
} }
@ -31,7 +36,7 @@ public function AddMutator(Mutator Mut)
if (Mut == Self) return; if (Mut == Self) return;
if (Mut.Class == Class) if (Mut.Class == Class)
Mut.Destroy(); ZedSpawnerMut(Mut).SafeDestroy();
else else
Super.AddMutator(Mut); Super.AddMutator(Mut);
} }