aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-04-17 14:23:26 +0100
committerGitHub <noreply@github.com>2022-04-17 14:23:26 +0100
commit6fdbd80dd796c9334f205606fdab8c141b922de0 (patch)
tree720ff414d5dcc82c9f2d74c5ae9b36c7a1770b7d /Northstar.CustomServers/mod/scripts
parent0c61ea8d1b62415f25b1e54230195d455269b6aa (diff)
downloadNorthstarMods-6fdbd80dd796c9334f205606fdab8c141b922de0.tar.gz
NorthstarMods-6fdbd80dd796c9334f205606fdab8c141b922de0.zip
allow modes to not use the match timer, and clear timer on match end (#310)
Diffstat (limited to 'Northstar.CustomServers/mod/scripts')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut13
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 e02ca7e3c..42aa4a628 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 )