diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-04-17 14:23:26 +0100 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-04-19 23:07:48 +0200 |
commit | 4590e95529c020c46f1ed53a5001caca5a3be1e4 (patch) | |
tree | 3c09b71865005db382c6d0984c871c661550f579 /Northstar.CustomServers/mod | |
parent | 6e8f81a9a9127654112c5b1cec227c764b4ca8fd (diff) | |
download | NorthstarMods-4590e95529c020c46f1ed53a5001caca5a3be1e4.tar.gz NorthstarMods-4590e95529c020c46f1ed53a5001caca5a3be1e4.zip |
allow modes to not use the match timer, and clear timer on match end (#310)
Diffstat (limited to 'Northstar.CustomServers/mod')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut index e02ca7e3..42aa4a62 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut @@ -9,6 +9,7 @@ global function AddCallback_OnRoundEndCleanup global function SetShouldUsePickLoadoutScreen global function SetSwitchSidesBased global function SetSuddenDeathBased +global function SetTimerBased global function SetShouldUseRoundWinningKillReplay global function SetRoundWinningKillReplayKillClasses global function SetRoundWinningKillReplayAttacker @@ -28,6 +29,7 @@ struct { bool usePickLoadoutScreen bool switchSidesBased bool suddenDeathBased + bool timerBased = true int functionref() timeoutWinnerDecisionFunc // for waitingforplayers @@ -228,7 +230,7 @@ void function GameStateEnter_Playing_Threaded() endTime = expect float( GetServerVar( "gameEndTime" ) ) // time's up! - if ( Time() >= endTime ) + if ( Time() >= endTime && file.timerBased ) { int winningTeam if ( file.timeoutWinnerDecisionFunc != null ) @@ -279,6 +281,10 @@ void function GameStateEnter_WinnerDetermined_Threaded() } WaitFrame() // wait a frame so other scripts can setup killreplay stuff + + // set gameEndTime to current time, so hud doesn't display time left in the match + SetServerVar( "gameEndTime", Time() ) + SetServerVar( "roundEndTime", Time() ) entity replayAttacker = file.roundWinningKillReplayAttacker bool doReplay = Replay_IsEnabled() && IsRoundWinningKillReplayEnabled() && IsValid( replayAttacker ) && !ClassicMP_ShouldRunEpilogue() @@ -715,6 +721,11 @@ void function SetSuddenDeathBased( bool suddenDeathBased ) file.suddenDeathBased = suddenDeathBased } +void function SetTimerBased( bool timerBased ) +{ + file.timerBased = timerBased +} + void function SetShouldUseRoundWinningKillReplay( bool shouldUse ) { SetServerVar( "roundWinningKillReplayEnabled", shouldUse ) |