diff options
author | Zanieon <william-millennium@hotmail.com> | 2024-08-30 15:03:52 +0200 |
---|---|---|
committer | Zanieon <william-millennium@hotmail.com> | 2024-08-30 15:03:52 +0200 |
commit | c674e3c0583c5c8eca136a5ebeb5ed2ac6cae6c4 (patch) | |
tree | 7aa6d2f738319cb1519f4ee62467bfe10800930d /Northstar.CustomServers/mod | |
parent | 3eb15eef1123f71e09e773adb15f52b5fa63a179 (diff) | |
download | NorthstarMods-c674e3c0583c5c8eca136a5ebeb5ed2ac6cae6c4.tar.gz NorthstarMods-c674e3c0583c5c8eca136a5ebeb5ed2ac6cae6c4.zip |
Move some drop flag related functions to end of file
in an effort to have all related functions close to each other
Part of the refactor in #830
Diffstat (limited to 'Northstar.CustomServers/mod')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut index 81971e00..72f43e18 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut @@ -287,26 +287,6 @@ void function GiveFlag( entity player, entity flag ) SetFlagStateForTeam( flag.GetTeam(), eFlagState.Away ) // used for held } -void function DropFlagIfPhased( entity player, entity flag ) -{ - player.EndSignal( "StartPhaseShift" ) - player.EndSignal( "OnDestroy" ) - - OnThreadEnd( function() : ( player ) - { - if (GetGameState() == eGameState.Playing || GetGameState() == eGameState.SuddenDeath) - DropFlag( player, true ) - }) - // the IsValid check is purely to prevent a crash due to a destroyed flag (epilogue) - while( IsValid(flag) && flag.GetParent() == player ) - WaitFrame() -} - -void function DropFlagForBecomingTitan( entity pilot, entity titan ) -{ - DropFlag( pilot, true ) -} - void function DropFlag( entity player, bool realDrop = true ) { entity flag = GetFlagForTeam( GetOtherTeam( player.GetTeam() ) ) @@ -344,15 +324,6 @@ void function DropFlag( entity player, bool realDrop = true ) SetFlagStateForTeam( flag.GetTeam(), eFlagState.Home ) // used for return prompt } -void function TrackFlagDropTimeout( entity flag ) -{ - flag.EndSignal( "ResetDropTimeout" ) - - wait CTF_GetDropTimeout() - - ResetFlag( flag ) -} - void function ResetFlag( entity flag ) { // prevents crash when flag is reset after it's been destroyed due to epilogue @@ -526,3 +497,32 @@ void function SetFlagStateForTeam( int team, int state ) SetGlobalNetInt( team == TEAM_IMC ? "imcFlagState" : "milFlagState", state ) } + +void function DropFlagIfPhased( entity player, entity flag ) +{ + player.EndSignal( "StartPhaseShift" ) + player.EndSignal( "OnDestroy" ) + + OnThreadEnd( function() : ( player ) + { + if (GetGameState() == eGameState.Playing || GetGameState() == eGameState.SuddenDeath) + DropFlag( player, true ) + }) + // the IsValid check is purely to prevent a crash due to a destroyed flag (epilogue) + while( IsValid(flag) && flag.GetParent() == player ) + WaitFrame() +} + +void function DropFlagForBecomingTitan( entity pilot, entity titan ) +{ + DropFlag( pilot, true ) +} + +void function TrackFlagDropTimeout( entity flag ) +{ + flag.EndSignal( "ResetDropTimeout" ) + + wait CTF_GetDropTimeout() + + ResetFlag( flag ) +} |