diff --git a/src/game/bot.c b/src/game/bot.c index 0658a1ce3..826bc2a51 100644 --- a/src/game/bot.c +++ b/src/game/bot.c @@ -260,6 +260,17 @@ void botSpawn(struct chrdata *chr, u8 respawning) chr->aibot->moveratex = 0; chr->aibot->moveratey = 0; func0f02e9a0(chr, 0); + +#ifndef PLATFORM_N64 + if ((g_MpSetup.options & MPOPTION_SPAWNWITHWEAPON) + && g_MpSetup.weapons[0] != MPWEAPON_NONE + && g_MpSetup.weapons[0] != MPWEAPON_DISABLED) { + struct mpweapon *mpweapon = &g_MpWeapons[g_MpSetup.weapons[0]]; + botinvGiveSingleWeapon(chr, mpweapon->weaponnum); + botactGiveAmmoByType(aibot, mpweapon->priammotype - 1, mpweapon->priammoqty / 2); + botinvSwitchToWeapon(chr, mpweapon->weaponnum, FUNC_PRIMARY); + } +#endif } } diff --git a/src/game/mplayer/scenarios/capturethecase.inc b/src/game/mplayer/scenarios/capturethecase.inc index b701a69c2..0e82d542a 100644 --- a/src/game/mplayer/scenarios/capturethecase.inc +++ b/src/game/mplayer/scenarios/capturethecase.inc @@ -60,6 +60,16 @@ struct menuitem g_CtcOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, +#ifndef PLATFORM_N64 + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"Spawn With Weapon", + MPOPTION_SPAWNWITHWEAPON, + menuhandlerMpCheckboxOption, + }, +#endif { MENUITEMTYPE_CHECKBOX, 0, diff --git a/src/game/mplayer/scenarios/combat.inc b/src/game/mplayer/scenarios/combat.inc index 74f4c6ad3..7d096a55c 100644 --- a/src/game/mplayer/scenarios/combat.inc +++ b/src/game/mplayer/scenarios/combat.inc @@ -55,6 +55,16 @@ struct menuitem g_MpCombatOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, +#ifndef PLATFORM_N64 + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"Spawn With Weapon", + MPOPTION_SPAWNWITHWEAPON, + menuhandlerMpCheckboxOption, + }, +#endif { MENUITEMTYPE_SEPARATOR, 0, diff --git a/src/game/mplayer/scenarios/hackthatmac.inc b/src/game/mplayer/scenarios/hackthatmac.inc index d065929ec..1ca58458a 100644 --- a/src/game/mplayer/scenarios/hackthatmac.inc +++ b/src/game/mplayer/scenarios/hackthatmac.inc @@ -58,6 +58,16 @@ struct menuitem g_HtmOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, +#ifndef PLATFORM_N64 + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"Spawn With Weapon", + MPOPTION_SPAWNWITHWEAPON, + menuhandlerMpCheckboxOption, + }, +#endif { MENUITEMTYPE_CHECKBOX, 0, diff --git a/src/game/mplayer/scenarios/holdthebriefcase.inc b/src/game/mplayer/scenarios/holdthebriefcase.inc index 4441a6050..fe9cc0bd6 100644 --- a/src/game/mplayer/scenarios/holdthebriefcase.inc +++ b/src/game/mplayer/scenarios/holdthebriefcase.inc @@ -58,6 +58,16 @@ struct menuitem g_HtbOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, +#ifndef PLATFORM_N64 + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"Spawn With Weapon", + MPOPTION_SPAWNWITHWEAPON, + menuhandlerMpCheckboxOption, + }, +#endif { MENUITEMTYPE_CHECKBOX, 0, diff --git a/src/game/mplayer/scenarios/kingofthehill.inc b/src/game/mplayer/scenarios/kingofthehill.inc index 050ff36b7..120024f19 100644 --- a/src/game/mplayer/scenarios/kingofthehill.inc +++ b/src/game/mplayer/scenarios/kingofthehill.inc @@ -79,6 +79,16 @@ struct menuitem g_KohOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, +#ifndef PLATFORM_N64 + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"Spawn With Weapon", + MPOPTION_SPAWNWITHWEAPON, + menuhandlerMpCheckboxOption, + }, +#endif { MENUITEMTYPE_CHECKBOX, 0, diff --git a/src/game/mplayer/scenarios/popacap.inc b/src/game/mplayer/scenarios/popacap.inc index d0cc31933..7da8ed521 100644 --- a/src/game/mplayer/scenarios/popacap.inc +++ b/src/game/mplayer/scenarios/popacap.inc @@ -56,6 +56,16 @@ struct menuitem g_PacOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, +#ifndef PLATFORM_N64 + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"Spawn With Weapon", + MPOPTION_SPAWNWITHWEAPON, + menuhandlerMpCheckboxOption, + }, +#endif { MENUITEMTYPE_CHECKBOX, 0, diff --git a/src/game/player.c b/src/game/player.c index 3ae336630..bb26bd28e 100644 --- a/src/game/player.c +++ b/src/game/player.c @@ -1099,8 +1099,21 @@ void playerSpawn(void) g_Vars.currentplayer->prop->chr->blurnumtimesdied = 0; } } else { - bgunEquipWeapon2(HAND_LEFT, g_DefaultWeapons[HAND_LEFT]); - bgunEquipWeapon2(HAND_RIGHT, g_DefaultWeapons[HAND_RIGHT]); +#ifndef PLATFORM_N64 + if ((g_MpSetup.options & MPOPTION_SPAWNWITHWEAPON) + && g_MpSetup.weapons[0] != MPWEAPON_NONE + && g_MpSetup.weapons[0] != MPWEAPON_DISABLED) { + struct mpweapon *mpweapon = &g_MpWeapons[g_MpSetup.weapons[0]]; + invGiveSingleWeapon(mpweapon->weaponnum); + bgunEquipWeapon2(HAND_LEFT, WEAPON_NONE); + bgunEquipWeapon2(HAND_RIGHT, mpweapon->weaponnum); + bgunSetAmmoQuantity(mpweapon->priammotype, mpweapon->priammoqty / 2); + } else +#endif + { + bgunEquipWeapon2(HAND_LEFT, g_DefaultWeapons[HAND_LEFT]); + bgunEquipWeapon2(HAND_RIGHT, g_DefaultWeapons[HAND_RIGHT]); + } #if VERSION >= VERSION_NTSC_1_0 if (g_Vars.currentplayer->model00d4 == NULL diff --git a/src/include/constants.h b/src/include/constants.h index 8b39686d4..4c3705b7f 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -2889,6 +2889,7 @@ #define MPOPTION_HTM_SHOWONRADAR 0x00040000 #define MPOPTION_PAC_HIGHLIGHTTARGET 0x00080000 #define MPOPTION_PAC_SHOWONRADAR 0x00100000 +#define MPOPTION_SPAWNWITHWEAPON 0x00200000 #define MPPAUSEMODE_UNPAUSED 0 #define MPPAUSEMODE_PAUSED 1