diff options
Diffstat (limited to 'Northstar.CustomServers')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut index 3bc11c3a..974481c1 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut @@ -21,6 +21,7 @@ void function GamemodeSpeedball_Init() AddSpawnCallbackEditorClass( "script_ref", "info_speedball_flag", CreateFlag ) + AddCallback_GameStateEnter( eGameState.Prematch, CreateFlagIfNoFlagSpawnpoint ) AddCallback_GameStateEnter( eGameState.Playing, ResetFlag ) AddCallback_OnTouchHealthKit( "item_flag", OnFlagCollected ) AddCallback_OnPlayerKilled( OnPlayerKilled ) @@ -114,6 +115,21 @@ void function DropFlag() file.flagCarrier = null } +void function CreateFlagIfNoFlagSpawnpoint() +{ + if ( IsValid( file.flag ) ) + return + + foreach ( entity hardpoint in GetEntArrayByClass_Expensive( "info_hardpoint" ) ) + { + if ( hardpoint.kv.hardpointGroup == "B" ) + { + CreateFlag( hardpoint ) + return + } + } +} + void function ResetFlag() { file.flag.ClearParent() |