aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/mp
diff options
context:
space:
mode:
authorRoyalBlue1 <realEmail@veryRealURL.com>2022-10-20 01:49:40 +0200
committerRoyalBlue1 <realEmail@veryRealURL.com>2022-10-20 01:49:40 +0200
commit3c00b69762435ba3c753495b191c379508fd5003 (patch)
tree01b6e3232e984efa1936af0196ef9525bd8165b1 /Northstar.CustomServers/mod/scripts/vscripts/mp
parent52dab1de818e957c3817548de9bf23c1471172dd (diff)
downloadNorthstarMods-3c00b69762435ba3c753495b191c379508fd5003.tar.gz
NorthstarMods-3c00b69762435ba3c753495b191c379508fd5003.zip
Add game end awards
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/mp')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut17
1 files changed, 15 insertions, 2 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
index 6cde4655..0732e131 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
@@ -24,6 +24,8 @@ global function ShouldRunEvac
global function GiveTitanToPlayer
global function GetTimeLimit_ForGameMode
+global function SetCallback_RunPostmatch
+
struct {
// used for togglable parts of gamestate
bool usePickLoadoutScreen
@@ -53,6 +55,7 @@ struct {
float roundWinningKillReplayHealthFrac
array<void functionref()> roundEndCleanupCallbacks
+ void functionref() postMatchCallback
} file
void function PIN_GameStart()
@@ -81,6 +84,8 @@ void function PIN_GameStart()
AddDeathCallback( "npc_titan", OnTitanKilled )
RegisterSignal( "CleanUpEntitiesForRoundEnd" )
+
+
}
void function SetGameState( int newState )
@@ -430,7 +435,7 @@ void function GameStateEnter_SwitchingSides_Threaded()
entity replayAttacker = file.roundWinningKillReplayAttacker
bool doReplay = Replay_IsEnabled() && IsRoundWinningKillReplayEnabled() && IsValid( replayAttacker ) && !IsRoundBased() // for roundbased modes, we've already done the replay
- && Time() - file.roundWinningKillReplayTime <= SWITCHING_SIDES_DELAY
+ && Time() - file.roundWinningKillReplayTime <= SWITCHING_SIDES_DELAY
float replayLength = SWITCHING_SIDES_DELAY_REPLAY // extra delay if no replay
if ( doReplay )
@@ -524,9 +529,17 @@ void function GameStateEnter_Postmatch()
thread GameStateEnter_Postmatch_Threaded()
}
+void function SetCallback_RunPostmatch(void functionref() callback)
+{
+ file.postMatchCallback = callback
+}
+
void function GameStateEnter_Postmatch_Threaded()
{
- wait GAME_POSTMATCH_LENGTH
+ if( file.postMatchCallback == null)
+ wait GAME_POSTMATCH_LENGTH
+ else
+ waitthread file.postMatchCallback()
GameRules_EndMatch()
}