From 476093aeb609918436f5bad0b50f68b29af8f270 Mon Sep 17 00:00:00 2001 From: Jonaeru Date: Sun, 19 May 2024 16:23:48 +0900 Subject: [PATCH] port: fix start armed mpoption --- src/game/bot.c | 2 +- src/game/mplayer/mplayer.c | 1 + src/game/mplayer/scenarios/capturethecase.inc | 2 +- src/game/mplayer/scenarios/combat.inc | 2 +- src/game/mplayer/scenarios/hackthatmac.inc | 2 +- src/game/mplayer/scenarios/holdthebriefcase.inc | 2 +- src/game/mplayer/scenarios/kingofthehill.inc | 2 +- src/game/mplayer/scenarios/popacap.inc | 2 +- src/game/player.c | 2 +- src/include/constants.h | 2 +- 10 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/game/bot.c b/src/game/bot.c index 2f087092f..71db756a9 100644 --- a/src/game/bot.c +++ b/src/game/bot.c @@ -262,7 +262,7 @@ void botSpawn(struct chrdata *chr, u8 respawning) func0f02e9a0(chr, 0); #ifndef PLATFORM_N64 - if ((g_MpSetup.options & MPOPTION_SPAWNWITHWEAPON) + if (!(g_MpSetup.options & MPOPTION_STARTARMED) && g_MpSetup.weapons[0] != MPWEAPON_NONE && g_MpSetup.weapons[0] != MPWEAPON_DISABLED && g_MpSetup.weapons[0] != MPWEAPON_SHIELD) { diff --git a/src/game/mplayer/mplayer.c b/src/game/mplayer/mplayer.c index 80b9a4c1f..5c64bfa26 100644 --- a/src/game/mplayer/mplayer.c +++ b/src/game/mplayer/mplayer.c @@ -539,6 +539,7 @@ void mpInit(void) | MPOPTION_PAC_SHOWONRADAR; #ifndef PLATFORM_N64 + g_MpSetup.options |= MPOPTION_STARTARMED; g_MpSetup.options |= MPOPTION_FRIENDLYFIRE; #endif diff --git a/src/game/mplayer/scenarios/capturethecase.inc b/src/game/mplayer/scenarios/capturethecase.inc index fa6d4946c..e29732572 100644 --- a/src/game/mplayer/scenarios/capturethecase.inc +++ b/src/game/mplayer/scenarios/capturethecase.inc @@ -66,7 +66,7 @@ struct menuitem g_CtcOptionsMenuItems[] = { 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, (uintptr_t)"Start Armed", - MPOPTION_SPAWNWITHWEAPON, + MPOPTION_STARTARMED, menuhandlerMpCheckboxOption, }, { diff --git a/src/game/mplayer/scenarios/combat.inc b/src/game/mplayer/scenarios/combat.inc index 5052aea0c..509ae372f 100644 --- a/src/game/mplayer/scenarios/combat.inc +++ b/src/game/mplayer/scenarios/combat.inc @@ -61,7 +61,7 @@ struct menuitem g_MpCombatOptionsMenuItems[] = { 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, (uintptr_t)"Start Armed", - MPOPTION_SPAWNWITHWEAPON, + MPOPTION_STARTARMED, menuhandlerMpCheckboxOption, }, { diff --git a/src/game/mplayer/scenarios/hackthatmac.inc b/src/game/mplayer/scenarios/hackthatmac.inc index 32a0a265a..cc472978c 100644 --- a/src/game/mplayer/scenarios/hackthatmac.inc +++ b/src/game/mplayer/scenarios/hackthatmac.inc @@ -64,7 +64,7 @@ struct menuitem g_HtmOptionsMenuItems[] = { 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, (uintptr_t)"Start Armed", - MPOPTION_SPAWNWITHWEAPON, + MPOPTION_STARTARMED, menuhandlerMpCheckboxOption, }, { diff --git a/src/game/mplayer/scenarios/holdthebriefcase.inc b/src/game/mplayer/scenarios/holdthebriefcase.inc index d0e36e7d0..8b7c6f45b 100644 --- a/src/game/mplayer/scenarios/holdthebriefcase.inc +++ b/src/game/mplayer/scenarios/holdthebriefcase.inc @@ -64,7 +64,7 @@ struct menuitem g_HtbOptionsMenuItems[] = { 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, (uintptr_t)"Start Armed", - MPOPTION_SPAWNWITHWEAPON, + MPOPTION_STARTARMED, menuhandlerMpCheckboxOption, }, { diff --git a/src/game/mplayer/scenarios/kingofthehill.inc b/src/game/mplayer/scenarios/kingofthehill.inc index 41810b9a6..9ebf74716 100644 --- a/src/game/mplayer/scenarios/kingofthehill.inc +++ b/src/game/mplayer/scenarios/kingofthehill.inc @@ -85,7 +85,7 @@ struct menuitem g_KohOptionsMenuItems[] = { 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, (uintptr_t)"Start Armed", - MPOPTION_SPAWNWITHWEAPON, + MPOPTION_STARTARMED, menuhandlerMpCheckboxOption, }, { diff --git a/src/game/mplayer/scenarios/popacap.inc b/src/game/mplayer/scenarios/popacap.inc index b667ad269..b4b5cf979 100644 --- a/src/game/mplayer/scenarios/popacap.inc +++ b/src/game/mplayer/scenarios/popacap.inc @@ -62,7 +62,7 @@ struct menuitem g_PacOptionsMenuItems[] = { 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, (uintptr_t)"Start Armed", - MPOPTION_SPAWNWITHWEAPON, + MPOPTION_STARTARMED, menuhandlerMpCheckboxOption, }, { diff --git a/src/game/player.c b/src/game/player.c index ddb73c726..99c657c3a 100644 --- a/src/game/player.c +++ b/src/game/player.c @@ -1104,7 +1104,7 @@ void playerSpawn(void) invGiveSingleWeapon(WEAPON_NIGHTVISION); } - if ((g_MpSetup.options & MPOPTION_SPAWNWITHWEAPON) + if (!(g_MpSetup.options & MPOPTION_STARTARMED) && g_MpSetup.weapons[0] != MPWEAPON_NONE && g_MpSetup.weapons[0] != MPWEAPON_DISABLED && g_MpSetup.weapons[0] != MPWEAPON_SHIELD) { diff --git a/src/include/constants.h b/src/include/constants.h index 09152e169..909cb82e3 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -2890,7 +2890,7 @@ #define MPOPTION_HTM_SHOWONRADAR 0x00040000 #define MPOPTION_PAC_HIGHLIGHTTARGET 0x00080000 #define MPOPTION_PAC_SHOWONRADAR 0x00100000 -#define MPOPTION_SPAWNWITHWEAPON 0x00200000 +#define MPOPTION_STARTARMED 0x00200000 #define MPOPTION_NODRUGBLUR 0x00400000 #define MPOPTION_AUTORANDOMWEAPON_START 0x00800000 #define MPOPTION_AUTORANDOMWEAPON_END 0x01000000