add short alias for mutator
This commit is contained in:
60
YAS/Classes/Mut.uc
Normal file
60
YAS/Classes/Mut.uc
Normal file
@ -0,0 +1,60 @@
|
||||
class Mut extends KFMutator;
|
||||
|
||||
var private YAS YAS;
|
||||
|
||||
public simulated function bool SafeDestroy()
|
||||
{
|
||||
return (bPendingDelete || bDeleteMe || Destroy());
|
||||
}
|
||||
|
||||
public event PreBeginPlay()
|
||||
{
|
||||
Super.PreBeginPlay();
|
||||
|
||||
if (WorldInfo.NetMode == NM_Client) return;
|
||||
|
||||
foreach WorldInfo.DynamicActors(class'YAS', YAS)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (YAS == None)
|
||||
{
|
||||
YAS = WorldInfo.Spawn(class'YAS');
|
||||
}
|
||||
|
||||
if (YAS == None)
|
||||
{
|
||||
`Log_Base("FATAL: Can't Spawn 'YAS'");
|
||||
SafeDestroy();
|
||||
}
|
||||
}
|
||||
|
||||
public function AddMutator(Mutator M)
|
||||
{
|
||||
if (M == Self) return;
|
||||
|
||||
if (M.Class == Class)
|
||||
Mut(M).SafeDestroy();
|
||||
else
|
||||
Super.AddMutator(M);
|
||||
}
|
||||
|
||||
public function NotifyLogin(Controller C)
|
||||
{
|
||||
YAS.NotifyLogin(C);
|
||||
|
||||
Super.NotifyLogin(C);
|
||||
}
|
||||
|
||||
public function NotifyLogout(Controller C)
|
||||
{
|
||||
YAS.NotifyLogout(C);
|
||||
|
||||
Super.NotifyLogout(C);
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
GroupNames.Add("Scoreboard")
|
||||
}
|
@ -1,60 +1 @@
|
||||
class YASMut extends KFMutator;
|
||||
|
||||
var private YAS YAS;
|
||||
|
||||
public simulated function bool SafeDestroy()
|
||||
{
|
||||
return (bPendingDelete || bDeleteMe || Destroy());
|
||||
}
|
||||
|
||||
public event PreBeginPlay()
|
||||
{
|
||||
Super.PreBeginPlay();
|
||||
|
||||
if (WorldInfo.NetMode == NM_Client) return;
|
||||
|
||||
foreach WorldInfo.DynamicActors(class'YAS', YAS)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (YAS == None)
|
||||
{
|
||||
YAS = WorldInfo.Spawn(class'YAS');
|
||||
}
|
||||
|
||||
if (YAS == None)
|
||||
{
|
||||
`Log_Base("FATAL: Can't Spawn 'YAS'");
|
||||
SafeDestroy();
|
||||
}
|
||||
}
|
||||
|
||||
public function AddMutator(Mutator Mut)
|
||||
{
|
||||
if (Mut == Self) return;
|
||||
|
||||
if (Mut.Class == Class)
|
||||
YASMut(Mut).SafeDestroy();
|
||||
else
|
||||
Super.AddMutator(Mut);
|
||||
}
|
||||
|
||||
public function NotifyLogin(Controller C)
|
||||
{
|
||||
YAS.NotifyLogin(C);
|
||||
|
||||
Super.NotifyLogin(C);
|
||||
}
|
||||
|
||||
public function NotifyLogout(Controller C)
|
||||
{
|
||||
YAS.NotifyLogout(C);
|
||||
|
||||
Super.NotifyLogout(C);
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
GroupNames.Add("Scoreboard")
|
||||
}
|
||||
class YASMut extends Mut; // backward compatibility
|
||||
|
Reference in New Issue
Block a user