From f3757e75e9e993e42893c44add38827de53e5b83 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Wed, 15 May 2024 12:10:17 +0200 Subject: [PATCH] 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);