diff --git a/code/REDALERT/FUNCTION.H b/code/REDALERT/FUNCTION.H index a52e3a9..7398f03 100644 --- a/code/REDALERT/FUNCTION.H +++ b/code/REDALERT/FUNCTION.H @@ -1096,6 +1096,10 @@ void Console_Tick(void); typedef void (*xcommand_t) (void); void Cmd_AddCommand(char* cmd_name, xcommand_t function); + +#include +extern jmp_buf select_game_jump; + /* ** Achievement event. ST - 11/11/2019 11:39AM */ diff --git a/code/REDALERT/INIT.CPP b/code/REDALERT/INIT.CPP index 2b811b0..78e4fbb 100644 --- a/code/REDALERT/INIT.CPP +++ b/code/REDALERT/INIT.CPP @@ -446,6 +446,9 @@ bool Init_Game(int , char * []) extern bool Get_Broadcast_Addresses (void); #endif + +jmp_buf select_game_jump; + /*********************************************************************************************** * Select_Game -- The game's main menu * * * @@ -515,6 +518,13 @@ bool Select_Game(bool fade) int cdcheck = 0; bool cs = Is_Counterstrike_Installed(); #endif + + setjmp(select_game_jump); + + if (Scen.warpIntoMap) { + Scen.warpIntoMap = false; + return true; + } // #ifndef DVD // Denzil - We want the menu screen ajw No we don't // if (Special.IsFromInstall) { diff --git a/code/REDALERT/MENUS.CPP b/code/REDALERT/MENUS.CPP index cc521e8..2c7b0ec 100644 --- a/code/REDALERT/MENUS.CPP +++ b/code/REDALERT/MENUS.CPP @@ -734,7 +734,6 @@ int Main_Menu(unsigned long ) bool display = true; bool process = true; while (process) { - #ifdef WIN32 /* ** If we have just received input focus again after running in the background then diff --git a/code/REDALERT/SCENARIO.CPP b/code/REDALERT/SCENARIO.CPP index 7314ecc..14f6b06 100644 --- a/code/REDALERT/SCENARIO.CPP +++ b/code/REDALERT/SCENARIO.CPP @@ -186,6 +186,7 @@ ScenarioClass::ScenarioClass(void) : memset(GlobalFlags, '\0', sizeof(GlobalFlags)); memset(Views, '\0', sizeof(Views)); // jmarshall + warpIntoMap = false; Cmd_AddCommand("map", Cmd_Map); // jmarshall end } @@ -3759,6 +3760,7 @@ void Cmd_Map(void) { Console_Printf("usage: map \n"); return; } - + Scen.warpIntoMap = true; Start_Scenario(Cmd_Argv(1)); + longjmp(select_game_jump, 1); } \ No newline at end of file diff --git a/code/REDALERT/SCENARIO.H b/code/REDALERT/SCENARIO.H index 3bf0d91..10eb9fc 100644 --- a/code/REDALERT/SCENARIO.H +++ b/code/REDALERT/SCENARIO.H @@ -327,6 +327,7 @@ class ScenarioClass { bool bOtherProposesDraw; // True if the other player in a 2-player game has a draw offer extended. #endif + bool warpIntoMap; };