From f3757e75e9e993e42893c44add38827de53e5b83 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Wed, 15 May 2024 12:10:17 +0200 Subject: [PATCH 1/2] port: don't crash when spawn with weapon is on and that weapon is a shield --- src/game/bot.c | 3 ++- src/game/player.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/game/bot.c b/src/game/bot.c index 826bc2a51..b9b4c0a2e 100644 --- a/src/game/bot.c +++ b/src/game/bot.c @@ -264,7 +264,8 @@ void botSpawn(struct chrdata *chr, u8 respawning) #ifndef PLATFORM_N64 if ((g_MpSetup.options & MPOPTION_SPAWNWITHWEAPON) && g_MpSetup.weapons[0] != MPWEAPON_NONE - && g_MpSetup.weapons[0] != MPWEAPON_DISABLED) { + && g_MpSetup.weapons[0] != MPWEAPON_DISABLED + && g_MpSetup.weapons[0] != MPWEAPON_SHIELD) { struct mpweapon *mpweapon = &g_MpWeapons[g_MpSetup.weapons[0]]; botinvGiveSingleWeapon(chr, mpweapon->weaponnum); botactGiveAmmoByType(aibot, mpweapon->priammotype - 1, mpweapon->priammoqty / 2); diff --git a/src/game/player.c b/src/game/player.c index a74753fa5..92ed2e15c 100644 --- a/src/game/player.c +++ b/src/game/player.c @@ -1106,7 +1106,8 @@ void playerSpawn(void) if ((g_MpSetup.options & MPOPTION_SPAWNWITHWEAPON) && g_MpSetup.weapons[0] != MPWEAPON_NONE - && g_MpSetup.weapons[0] != MPWEAPON_DISABLED) { + && g_MpSetup.weapons[0] != MPWEAPON_DISABLED + && g_MpSetup.weapons[0] != MPWEAPON_SHIELD) { struct mpweapon *mpweapon = &g_MpWeapons[g_MpSetup.weapons[0]]; invGiveSingleWeapon(mpweapon->weaponnum); bgunEquipWeapon2(HAND_LEFT, WEAPON_NONE); From 9edfd667b7f2183ab4ee03cbec524797c03aeeb2 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Wed, 15 May 2024 12:13:35 +0200 Subject: [PATCH 2/2] port: give start with weapon a better short name --- 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 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/game/mplayer/scenarios/capturethecase.inc b/src/game/mplayer/scenarios/capturethecase.inc index 192b8923c..fa6d4946c 100644 --- a/src/game/mplayer/scenarios/capturethecase.inc +++ b/src/game/mplayer/scenarios/capturethecase.inc @@ -65,7 +65,7 @@ struct menuitem g_CtcOptionsMenuItems[] = { MENUITEMTYPE_CHECKBOX, 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Spawn With Gun", + (uintptr_t)"Start Armed", MPOPTION_SPAWNWITHWEAPON, menuhandlerMpCheckboxOption, }, diff --git a/src/game/mplayer/scenarios/combat.inc b/src/game/mplayer/scenarios/combat.inc index 854e38319..5052aea0c 100644 --- a/src/game/mplayer/scenarios/combat.inc +++ b/src/game/mplayer/scenarios/combat.inc @@ -60,7 +60,7 @@ struct menuitem g_MpCombatOptionsMenuItems[] = { MENUITEMTYPE_CHECKBOX, 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Spawn With Gun", + (uintptr_t)"Start Armed", MPOPTION_SPAWNWITHWEAPON, menuhandlerMpCheckboxOption, }, diff --git a/src/game/mplayer/scenarios/hackthatmac.inc b/src/game/mplayer/scenarios/hackthatmac.inc index 9a7cf4b42..32a0a265a 100644 --- a/src/game/mplayer/scenarios/hackthatmac.inc +++ b/src/game/mplayer/scenarios/hackthatmac.inc @@ -63,7 +63,7 @@ struct menuitem g_HtmOptionsMenuItems[] = { MENUITEMTYPE_CHECKBOX, 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Spawn With Gun", + (uintptr_t)"Start Armed", MPOPTION_SPAWNWITHWEAPON, menuhandlerMpCheckboxOption, }, diff --git a/src/game/mplayer/scenarios/holdthebriefcase.inc b/src/game/mplayer/scenarios/holdthebriefcase.inc index b4bfedf75..d0e36e7d0 100644 --- a/src/game/mplayer/scenarios/holdthebriefcase.inc +++ b/src/game/mplayer/scenarios/holdthebriefcase.inc @@ -63,7 +63,7 @@ struct menuitem g_HtbOptionsMenuItems[] = { MENUITEMTYPE_CHECKBOX, 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Spawn With Gun", + (uintptr_t)"Start Armed", MPOPTION_SPAWNWITHWEAPON, menuhandlerMpCheckboxOption, }, diff --git a/src/game/mplayer/scenarios/kingofthehill.inc b/src/game/mplayer/scenarios/kingofthehill.inc index ff72ea228..41810b9a6 100644 --- a/src/game/mplayer/scenarios/kingofthehill.inc +++ b/src/game/mplayer/scenarios/kingofthehill.inc @@ -84,7 +84,7 @@ struct menuitem g_KohOptionsMenuItems[] = { MENUITEMTYPE_CHECKBOX, 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Spawn With Gun", + (uintptr_t)"Start Armed", MPOPTION_SPAWNWITHWEAPON, menuhandlerMpCheckboxOption, }, diff --git a/src/game/mplayer/scenarios/popacap.inc b/src/game/mplayer/scenarios/popacap.inc index 7e37939f7..b667ad269 100644 --- a/src/game/mplayer/scenarios/popacap.inc +++ b/src/game/mplayer/scenarios/popacap.inc @@ -61,7 +61,7 @@ struct menuitem g_PacOptionsMenuItems[] = { MENUITEMTYPE_CHECKBOX, 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Spawn With Gun", + (uintptr_t)"Start Armed", MPOPTION_SPAWNWITHWEAPON, menuhandlerMpCheckboxOption, },