diff --git a/src/game/bot.c b/src/game/bot.c index b9b4c0a2e..2f087092f 100644 --- a/src/game/bot.c +++ b/src/game/bot.c @@ -268,7 +268,14 @@ void botSpawn(struct chrdata *chr, u8 respawning) && 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); + const s32 ammotype = (g_MpSetup.weapons[0] == MPWEAPON_COMBATBOOST) ? AMMOTYPE_BOOST : mpweapon->priammotype; + if (ammotype) { + s32 startammo = mpweapon->priammoqty / 2; + if (startammo == 0) { + startammo = 1; + } + botactGiveAmmoByType(aibot, ammotype, startammo); + } botinvSwitchToWeapon(chr, mpweapon->weaponnum, FUNC_PRIMARY); } #endif diff --git a/src/game/player.c b/src/game/player.c index f7ac65eb9..389195977 100644 --- a/src/game/player.c +++ b/src/game/player.c @@ -1111,9 +1111,16 @@ void playerSpawn(void) && g_MpSetup.weapons[0] != MPWEAPON_SHIELD) { struct mpweapon *mpweapon = &g_MpWeapons[g_MpSetup.weapons[0]]; invGiveSingleWeapon(mpweapon->weaponnum); + const s32 ammotype = (g_MpSetup.weapons[0] == MPWEAPON_COMBATBOOST) ? AMMOTYPE_BOOST : mpweapon->priammotype; + if (ammotype) { + s32 startammo = mpweapon->priammoqty / 2; + if (startammo == 0) { + startammo = 1; + } + bgunSetAmmoQuantity(ammotype, startammo); + } bgunEquipWeapon2(HAND_LEFT, WEAPON_NONE); bgunEquipWeapon2(HAND_RIGHT, mpweapon->weaponnum); - bgunSetAmmoQuantity(mpweapon->priammotype, mpweapon->priammoqty / 2); } else #endif {