KF2-YetAnotherScoreboard/YAS/Classes/YASMut.uc

60 lines
832 B
Ucode
Raw Normal View History

2022-09-03 17:26:40 +00:00
class YASMut extends KFMutator;
2021-06-12 20:11:37 +00:00
2022-09-03 17:26:40 +00:00
var private YAS YAS;
2021-05-31 01:46:53 +00:00
2022-09-03 17:26:40 +00:00
public simulated function bool SafeDestroy()
2021-05-31 01:46:53 +00:00
{
2022-09-03 17:26:40 +00:00
return (bPendingDelete || bDeleteMe || Destroy());
2021-06-12 20:11:37 +00:00
}
2022-09-03 17:26:40 +00:00
public event PreBeginPlay()
2021-05-31 01:46:53 +00:00
{
2022-09-03 17:26:40 +00:00
Super.PreBeginPlay();
2021-06-12 20:11:37 +00:00
2022-09-03 17:26:40 +00:00
if (WorldInfo.NetMode == NM_Client) return;
2021-07-05 03:02:30 +00:00
2022-09-03 17:26:40 +00:00
foreach WorldInfo.DynamicActors(class'YAS', YAS)
2021-05-31 01:46:53 +00:00
{
2022-09-03 17:26:40 +00:00
break;
2021-05-31 01:46:53 +00:00
}
2021-06-12 20:11:37 +00:00
2022-09-03 17:26:40 +00:00
if (YAS == None)
2021-05-31 01:46:53 +00:00
{
2022-09-03 17:26:40 +00:00
YAS = WorldInfo.Spawn(class'YAS');
2021-06-12 18:44:20 +00:00
}
2022-09-03 17:26:40 +00:00
if (YAS == None)
2021-06-12 18:44:20 +00:00
{
2022-09-03 17:26:40 +00:00
`Log_Base("FATAL: Can't Spawn 'YAS'");
SafeDestroy();
2021-05-31 01:46:53 +00:00
}
2020-01-10 13:14:11 +00:00
}
2022-09-03 17:26:40 +00:00
public function AddMutator(Mutator Mut)
{
2022-09-03 17:26:40 +00:00
if (Mut == Self) return;
2021-06-12 20:11:37 +00:00
2022-09-03 17:26:40 +00:00
if (Mut.Class == Class)
Mut.Destroy();
else
Super.AddMutator(Mut);
2021-05-31 01:46:53 +00:00
}
2022-09-03 17:26:40 +00:00
public function NotifyLogin(Controller C)
2021-06-12 18:44:20 +00:00
{
2022-09-03 17:26:40 +00:00
YAS.NotifyLogin(C);
2021-06-12 18:44:20 +00:00
2022-09-03 17:26:40 +00:00
Super.NotifyLogin(C);
2021-06-12 18:44:20 +00:00
}
2022-09-03 17:26:40 +00:00
public function NotifyLogout(Controller C)
2021-06-12 18:44:20 +00:00
{
2022-09-03 17:26:40 +00:00
YAS.NotifyLogout(C);
2021-06-12 20:11:37 +00:00
2022-09-03 17:26:40 +00:00
Super.NotifyLogout(C);
2021-06-12 18:44:20 +00:00
}
2022-09-03 17:26:40 +00:00
DefaultProperties
2021-05-31 01:46:53 +00:00
{
2020-01-10 13:14:11 +00:00
}