diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-31 03:27:04 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-31 03:27:04 +0000 |
commit | 33e8e0c9a517bf6f7ac558ed54c8cd3db35fd514 (patch) | |
tree | 076b3a9efa61c93a68ee1a7d9c0146e23aec5ccb | |
parent | b7eae961af2635dfa0411d7271d11f554a31af1b (diff) | |
download | NorthstarMods-33e8e0c9a517bf6f7ac558ed54c8cd3db35fd514.tar.gz NorthstarMods-33e8e0c9a517bf6f7ac558ed54c8cd3db35fd514.zip |
allow lf to work on non-lf maps
-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() |