aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-01-25 18:43:23 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-01-25 18:43:23 +0000
commite3021b7339c9632777f1be1dbc045d18327085f2 (patch)
tree69a8e42cca36e48410e7d17a6e0b85f875808b0f /Northstar.CustomServers/mod/scripts
parent54cd96aed5b20912f60983bb5e77e67c261f32d8 (diff)
downloadNorthstarMods-e3021b7339c9632777f1be1dbc045d18327085f2.tar.gz
NorthstarMods-e3021b7339c9632777f1be1dbc045d18327085f2.zip
bring classic_mp 0 behaviour inline with official servers
Diffstat (limited to 'Northstar.CustomServers/mod/scripts')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_classic_mp.nut15
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut4
2 files changed, 17 insertions, 2 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_classic_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_classic_mp.nut
index 2baf119c..33bc8155 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_classic_mp.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_classic_mp.nut
@@ -1,6 +1,8 @@
untyped
global function ClassicMp_Init
global function ClassicMP_TryDefaultIntroSetup
+global function ClassicMP_SetShouldTryIntroAndEpilogueWithoutClassicMP
+global function ClassicMP_ShouldTryIntroAndEpilogueWithoutClassicMP
// intro setups
global function ClassicMP_SetLevelIntro
@@ -21,6 +23,8 @@ global function ClassicMP_ShouldRunEpilogue
global function GetClassicMPMode
struct {
+ bool shouldTryIntroAndEpilogueWithoutClassicMP = false
+
// level intros have a lower priority than custom intros
// level intros are used only if a custom intro was not specified
void functionref() levelIntroSetupFunc
@@ -46,7 +50,18 @@ void function ClassicMp_Init()
// stub func, called in mp_sh_init
void function ClassicMP_TryDefaultIntroSetup()
{
+}
+
+// this is for custom intros that might not want to use the preexisting classic_mp logic on client
+// in particular, tf1 campaign intros don't do this
+void function ClassicMP_SetShouldTryIntroAndEpilogueWithoutClassicMP( bool shouldTryIntroAndEpilogueWithoutClassicMP )
+{
+ file.shouldTryIntroAndEpilogueWithoutClassicMP = shouldTryIntroAndEpilogueWithoutClassicMP
+}
+bool function ClassicMP_ShouldTryIntroAndEpilogueWithoutClassicMP()
+{
+ return file.shouldTryIntroAndEpilogueWithoutClassicMP
}
void function ClassicMP_SetLevelIntro( void functionref() setupFunc, float introLength )
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
index e5c8799d..ddf8cd8d 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
@@ -97,7 +97,7 @@ void function SetGameState( int newState )
void function GameState_EntitiesDidLoad()
{
- if ( GetClassicMPMode() )
+ if ( GetClassicMPMode() || ClassicMP_ShouldTryIntroAndEpilogueWithoutClassicMP() )
ClassicMP_SetupIntro()
}
@@ -180,7 +180,7 @@ void function GameStateEnter_Prematch()
SetServerVar( "gameEndTime", Time() + timeLimit + ClassicMP_GetIntroLength() )
SetServerVar( "roundEndTime", Time() + ClassicMP_GetIntroLength() + GameMode_GetRoundTimeLimit( GAMETYPE ) * 60 )
- if ( !GetClassicMPMode() )
+ if ( !GetClassicMPMode() && !ClassicMP_ShouldTryIntroAndEpilogueWithoutClassicMP() )
thread StartGameWithoutClassicMP()
}