mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-23 15:52:41 +02:00
port: net: fix main menu lockup after playing a 5+ player game
This commit is contained in:
1 parent
4eca4a1f07
commit
9f6b21e870
3 files changed
+26
-6
No files matched your search
+22
-2
@@ -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];
|
||||
|
||||
+2
-2
@@ -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();
|
||||
}
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user