From 0c82545ba92b9fce5d9cc75a3770ebdf3ab4e610 Mon Sep 17 00:00:00 2001 From: Matthew Coppola Date: Sun, 7 Dec 2025 07:11:13 -0500 Subject: [PATCH] Preserve Combat Simulator sim list after Co-Op/Counter-Op --- port/src/pdmain.c | 3 +++ src/game/menutick.c | 6 ++++++ src/include/types.h | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/port/src/pdmain.c b/port/src/pdmain.c index 344e954fd..277bf378d 100644 --- a/port/src/pdmain.c +++ b/port/src/pdmain.c @@ -462,6 +462,9 @@ void mainLoop(void) } if (g_Vars.coopplayernum >= 0 || g_Vars.antiplayernum >= 0) { + if (g_MpSetup.chrslots & 0xfff0) { + g_MpSetup.storedbotbits = g_MpSetup.chrslots & 0xfff0; + } g_MpSetup.chrslots = 0x03; mpReset(); } else if (g_Vars.perfectbuddynum) { diff --git a/src/game/menutick.c b/src/game/menutick.c index 671d33cc0..79d5f2b12 100644 --- a/src/game/menutick.c +++ b/src/game/menutick.c @@ -286,6 +286,12 @@ void menuTick(void) if (g_MenuData.root == MENUROOT_MPSETUP || g_MenuData.root == MENUROOT_4MBMAINMENU) { if (g_MenuData.prevmenuroot == -1) { +#ifndef PLATFORM_N64 + if (g_MpSetup.storedbotbits) { + g_MpSetup.chrslots |= g_MpSetup.storedbotbits; + g_MpSetup.storedbotbits = 0; + } +#endif g_MpSetup.chrslots &= 0xfff0; } diff --git a/src/include/types.h b/src/include/types.h index ab4040c4e..ccb808e04 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -4107,6 +4107,11 @@ struct mpsetup { /*0x800acba0*/ u8 weapons[NUM_MPWEAPONSLOTS]; /*0x800acba6*/ u8 paused; /*0x800acba8*/ struct fileguid fileguid; +#ifndef PLATFORM_N64 + // Used to restore the non-player bits of chrslots upon entering Combat + // Simulator, after playing Co-Op/Counter-Op with a human sim. + u16 storedbotbits; +#endif }; struct bossfile {