From e3021b7339c9632777f1be1dbc045d18327085f2 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Tue, 25 Jan 2022 18:43:23 +0000 Subject: bring classic_mp 0 behaviour inline with official servers --- .../mod/scripts/vscripts/mp/_classic_mp.nut | 15 +++++++++++++++ .../mod/scripts/vscripts/mp/_gamestate_mp.nut | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts/vscripts') 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() } -- cgit v1.2.3