optimize KillZeds
This commit is contained in:
parent
8e213d4f78
commit
23424ad094
@ -258,7 +258,7 @@ private function SetWave(int NewWaveNum, PlayerController PC, optional bool bSki
|
||||
}
|
||||
|
||||
//Kill all zeds currently alive.
|
||||
PC.ConsoleCommand("KillZeds");
|
||||
KillZeds();
|
||||
|
||||
//Clear any current objectives.
|
||||
KFGRI.DeactivateObjective();
|
||||
@ -446,7 +446,7 @@ private function StartWaveTimer()
|
||||
{
|
||||
if (KFDemoRecSpectator(PC) == none)
|
||||
{
|
||||
PC.ConsoleCommand("KillZeds");
|
||||
KillZeds();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -508,6 +508,21 @@ private function UpdateTraderDurationTimer()
|
||||
}
|
||||
}
|
||||
|
||||
private function KillZeds()
|
||||
{
|
||||
local KFPawn_Monster KFPM;
|
||||
|
||||
foreach WorldInfo.AllPawns(class'KFPawn_Monster', KFPM)
|
||||
{
|
||||
if (!KFPM.IsAliveAndWell()) continue;
|
||||
|
||||
if (KFPM.Health > 0 && PlayerController(KFPM.Controller) == None)
|
||||
{
|
||||
KFPM.Died(None, None, KFPM.Location);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
|
||||
|
@ -32,7 +32,7 @@ public event PreBeginPlay()
|
||||
|
||||
public function AddMutator(Mutator Mut)
|
||||
{
|
||||
if (Mut == Self || bPendingDelete || bDeleteMe) return;
|
||||
if (Mut == Self) return;
|
||||
|
||||
if (Mut.Class == Class)
|
||||
StartWaveMut(Mut).SafeDestroy();
|
||||
|
Loading…
Reference in New Issue
Block a user