From 33e8e0c9a517bf6f7ac558ed54c8cd3db35fd514 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Fri, 31 Dec 2021 03:27:04 +0000 Subject: allow lf to work on non-lf maps --- .../scripts/vscripts/gamemodes/_gamemode_speedball.nut | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Northstar.CustomServers') 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() -- cgit v1.2.3