diff --git a/port/src/net/net.c b/port/src/net/net.c index 1a02722a8..a0349bac3 100644 --- a/port/src/net/net.c +++ b/port/src/net/net.c @@ -17,6 +17,10 @@ #include "game/bondgun.h" #include "game/game_1531a0.h" #include "game/game_0b0fd0.h" +#include "game/title.h" +#include "game/menu.h" +#include "game/pdmode.h" +#include "game/mplayer/mplayer.h" #include "lib/main.h" #include "lib/vi.h" #include "config.h" @@ -504,8 +508,24 @@ s32 netDisconnect(void) sysLogPrintf(LOG_CHAT, "NET: disconnected"); if (wasingame) { + // skip the "want to save" dialog for all players + for (s32 i = 0; i < MAX_PLAYERS; ++i) { + if (g_Vars.players[i]) { + g_PlayerConfigsArray[i].options |= OPTION_ASKEDSAVEPLAYER; + } + } + // end the stage immediately mainEndStage(); + // try to drop back to main menu with 1 player + mpSetPaused(MPPAUSEMODE_UNPAUSED); g_MpSetup.chrslots = 1; + g_Vars.mplayerisrunning = false; + g_Vars.normmplayerisrunning = false; + g_Vars.lvmpbotlevel = 0; + titleSetNextStage(STAGE_CITRAINING); + setNumPlayers(1); + titleSetNextMode(TITLEMODE_SKIP); + mainChangeToStage(STAGE_CITRAINING); } return 0; @@ -850,8 +870,8 @@ void netPlayersAllocate(void) cfg->options = g_PlayerConfigsArray[0].options & OPTION_PAINTBALL; cfg->options |= cl->settings.options & ~OPTION_PAINTBALL; // don't enable toggle aim, invert pitch or lookahead for remote players - cfg->options &= ~(OPTION_AIMCONTROL | OPTION_LOOKAHEAD | OPTION_ASKEDSAVEPLAYER); - cfg->options |= OPTION_FORWARDPITCH; + cfg->options &= ~(OPTION_AIMCONTROL | OPTION_LOOKAHEAD); + cfg->options |= OPTION_FORWARDPITCH | OPTION_ASKEDSAVEPLAYER; } cl->config = &g_PlayerConfigsArray[cl->playernum]; diff --git a/port/src/pdmain.c b/port/src/pdmain.c index b0c5e27c4..b08870abd 100644 --- a/port/src/pdmain.c +++ b/port/src/pdmain.c @@ -585,7 +585,7 @@ void mainEndStage(void) s32 prevplayernum = g_Vars.currentplayernum; s32 i; - for (i = 0; i < PLAYERCOUNT(); i++) { + for (i = 0; i < LOCALPLAYERCOUNT(); i++) { setCurrentPlayerNum(i); endscreenPushCoop(); } @@ -596,7 +596,7 @@ void mainEndStage(void) s32 prevplayernum = g_Vars.currentplayernum; s32 i; - for (i = 0; i < PLAYERCOUNT(); i++) { + for (i = 0; i < LOCALPLAYERCOUNT(); i++) { setCurrentPlayerNum(i); endscreenPushAnti(); } diff --git a/src/game/lv.c b/src/game/lv.c index 988e5f760..28f2ac004 100644 --- a/src/game/lv.c +++ b/src/game/lv.c @@ -349,7 +349,7 @@ void lvReset(s32 stagenum) } if (g_Vars.mplayerisrunning == false) { - g_Vars.playerstats[0].mpindex = 4; + g_Vars.playerstats[0].mpindex = MAX_PLAYERS; g_PlayerConfigsArray[MAX_PLAYERS].contpad1 = 0; g_PlayerConfigsArray[MAX_PLAYERS].contpad2 = 1; } @@ -1700,7 +1700,7 @@ Gfx *lvRender(Gfx *gdl) artifactsTick(); #ifndef PLATFORM_N64 - if ((g_NetMode && i) || i > MAX_LOCAL_PLAYERS) { + if ((g_NetMode && i) || i >= MAX_LOCAL_PLAYERS) { gdl = savedgdl; } #endif