-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from GenZmeY/short-name
add short alias for mutator
- Loading branch information
Showing
3 changed files
with
50 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
class Mut extends KFMutator | ||
dependson(TRB); | ||
|
||
var private TRB TRB; | ||
|
||
public simulated function bool SafeDestroy() | ||
{ | ||
return (bPendingDelete || bDeleteMe || Destroy()); | ||
} | ||
|
||
public event PreBeginPlay() | ||
{ | ||
Super.PreBeginPlay(); | ||
|
||
if (WorldInfo.NetMode == NM_Client) return; | ||
|
||
foreach WorldInfo.DynamicActors(class'TRB', TRB) | ||
{ | ||
break; | ||
} | ||
|
||
if (TRB == None) | ||
{ | ||
TRB = WorldInfo.Spawn(class'TRB'); | ||
} | ||
|
||
if (TRB == None) | ||
{ | ||
`Log_Base("FATAL: Can't Spawn 'TRB'"); | ||
SafeDestroy(); | ||
} | ||
} | ||
|
||
public function AddMutator(Mutator M) | ||
{ | ||
if (M == Self) return; | ||
|
||
if (M.Class == Class) | ||
Mut(M).SafeDestroy(); | ||
else | ||
Super.AddMutator(M); | ||
} | ||
|
||
defaultproperties | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1 @@ | ||
class TRBMut extends KFMutator | ||
dependson(TRB); | ||
|
||
var private TRB TRB; | ||
|
||
public simulated function bool SafeDestroy() | ||
{ | ||
return (bPendingDelete || bDeleteMe || Destroy()); | ||
} | ||
|
||
public event PreBeginPlay() | ||
{ | ||
Super.PreBeginPlay(); | ||
|
||
if (WorldInfo.NetMode == NM_Client) return; | ||
|
||
foreach WorldInfo.DynamicActors(class'TRB', TRB) | ||
{ | ||
break; | ||
} | ||
|
||
if (TRB == None) | ||
{ | ||
TRB = WorldInfo.Spawn(class'TRB'); | ||
} | ||
|
||
if (TRB == None) | ||
{ | ||
`Log_Base("FATAL: Can't Spawn 'TRB'"); | ||
SafeDestroy(); | ||
} | ||
} | ||
|
||
public function AddMutator(Mutator Mut) | ||
{ | ||
if (Mut == Self) return; | ||
|
||
if (Mut.Class == Class) | ||
TRBMut(Mut).SafeDestroy(); | ||
else | ||
Super.AddMutator(Mut); | ||
} | ||
|
||
defaultproperties | ||
{ | ||
|
||
} | ||
class TRBMut extends Mut; // backward compatibility |