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

82 lines
1.3 KiB
Ucode
Raw Normal View History

2022-08-01 11:09:38 +00:00
class MSKGS_Mut extends KFMutator
config(MSKGS);
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 bool CheckRelevance(Actor A)
2021-06-22 21:58:28 +00:00
{
2022-08-16 06:59:16 +00:00
local bool Relevance;
2021-03-31 21:27:53 +00:00
2022-08-16 06:59:16 +00:00
Relevance = Super.CheckRelevance(A);
if (Relevance)
2021-03-31 21:27:53 +00:00
{
2022-08-16 06:59:16 +00:00
MSKGS.ModifyLifespan(A);
2021-03-31 21:27:53 +00:00
}
2022-08-16 06:59:16 +00:00
return Relevance;
2021-12-26 04:18:50 +00:00
}
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
}