KF2-MSK-GS/MSKGS-SRV/Classes/MSKGS_Mut.uc

68 lines
1.1 KiB
Ucode
Raw Normal View History

2022-09-26 10:07:26 +00:00
class MSKGS_Mut extends KFMutator;
2021-02-25 23:55:43 +00:00
2022-08-16 06:59:16 +00:00
var private MSKGS MSKGS;
2021-04-14 01:28:23 +00:00
2022-08-16 06:59:16 +00:00
public simulated function bool SafeDestroy()
2022-03-24 05:07:21 +00:00
{
2022-08-16 06:59:16 +00:00
return (bPendingDelete || bDeleteMe || Destroy());
2022-03-24 05:07:21 +00:00
}
2021-02-26 00:13:55 +00:00
2022-08-16 06:59:16 +00:00
public event PreBeginPlay()
2021-04-14 01:28:23 +00:00
{
2022-08-16 06:59:16 +00:00
Super.PreBeginPlay();
2021-02-25 23:55:43 +00:00
2022-08-16 06:59:16 +00:00
if (WorldInfo.NetMode == NM_Client) return;
2022-03-21 17:49:44 +00:00
2022-08-16 06:59:16 +00:00
foreach WorldInfo.DynamicActors(class'MSKGS', MSKGS)
2021-02-20 10:30:45 +00:00
{
2022-08-16 06:59:16 +00:00
break;
2021-02-20 10:30:45 +00:00
}
2022-03-21 17:49:44 +00:00
2022-08-16 06:59:16 +00:00
if (MSKGS == None)
2022-01-03 21:16:16 +00:00
{
2022-08-16 06:59:16 +00:00
MSKGS = WorldInfo.Spawn(class'MSKGS');
2022-01-03 21:16:16 +00:00
}
2021-12-09 04:34:12 +00:00
2022-08-16 06:59:16 +00:00
if (MSKGS == None)
2022-03-21 17:10:41 +00:00
{
2022-08-16 06:59:16 +00:00
`Log_Base("FATAL: Can't Spawn 'MSKGS'");
SafeDestroy();
2022-03-21 17:10:41 +00:00
}
2021-02-20 10:30:45 +00:00
}
2022-08-16 06:59:16 +00:00
public function InitMutator(String Options, out String ErrorMessage)
2021-02-20 10:30:45 +00:00
{
2022-08-16 06:59:16 +00:00
Super.InitMutator(Options, ErrorMessage);
2021-04-14 01:28:23 +00:00
2022-08-16 06:59:16 +00:00
MSKGS.SetMaxPlayers(class'GameInfo'.static.GetIntOption(Options, "MaxPlayers", INDEX_NONE));
2021-04-14 01:28:23 +00:00
}
2022-08-16 06:59:16 +00:00
public function AddMutator(Mutator Mut)
2021-04-14 01:28:23 +00:00
{
if (Mut == Self) return;
2021-02-20 10:30:45 +00:00
if (Mut.Class == Class)
Mut.Destroy();
else
Super.AddMutator(Mut);
}
2022-08-16 06:59:16 +00:00
public function NotifyLogin(Controller C)
2021-06-22 21:58:28 +00:00
{
2022-08-16 06:59:16 +00:00
MSKGS.NotifyLogin(C);
2022-03-21 17:49:44 +00:00
2022-08-16 06:59:16 +00:00
Super.NotifyLogin(C);
2021-06-22 21:58:28 +00:00
}
2022-08-16 06:59:16 +00:00
public function NotifyLogout(Controller C)
2021-06-22 21:58:28 +00:00
{
2022-08-16 06:59:16 +00:00
MSKGS.NotifyLogout(C);
2022-03-21 17:49:44 +00:00
2022-08-16 06:59:16 +00:00
Super.NotifyLogout(C);
2021-06-22 21:58:28 +00:00
}
2021-02-20 10:30:45 +00:00
defaultproperties
{
2022-08-16 06:59:16 +00:00
2021-02-20 10:30:45 +00:00
}