KF2-ZedSpawner/ZedSpawner/Classes/ZedSpawnerMut.uc

58 lines
912 B
Ucode
Raw Normal View History

2022-05-11 12:43:39 +00:00
class ZedSpawnerMut extends KFMutator
dependson(ZedSpawner);
var private ZedSpawner ZS;
2022-07-13 06:56:35 +00:00
public event PreBeginPlay()
2022-05-11 12:43:39 +00:00
{
Super.PreBeginPlay();
if (WorldInfo.NetMode == NM_Client) return;
foreach WorldInfo.DynamicActors(class'ZedSpawner', ZS)
{
2022-07-13 07:00:06 +00:00
`Log_Base("Found 'ZedSpawner'");
2022-05-11 12:43:39 +00:00
break;
}
if (ZS == None)
{
2022-07-13 07:00:06 +00:00
`Log_Base("Spawn 'ZedSpawner'");
2022-05-11 12:43:39 +00:00
ZS = WorldInfo.Spawn(class'ZedSpawner');
}
if (ZS == None)
{
2022-07-13 07:00:06 +00:00
`Log_Base("Can't Spawn 'ZedSpawner', Destroy...");
2022-05-11 12:43:39 +00:00
Destroy();
}
}
public function AddMutator(Mutator Mut)
{
if (Mut == Self) return;
if (Mut.Class == Class)
Mut.Destroy();
else
Super.AddMutator(Mut);
}
2022-07-13 06:56:35 +00:00
public function NotifyLogin(Controller C)
2022-05-13 07:02:34 +00:00
{
Super.NotifyLogin(C);
ZS.NotifyLogin(C);
}
2022-07-13 06:56:35 +00:00
public function NotifyLogout(Controller C)
2022-05-13 07:02:34 +00:00
{
Super.NotifyLogout(C);
ZS.NotifyLogout(C);
}
2022-05-11 12:43:39 +00:00
DefaultProperties
{
}