forked from Ports/perfect_dark
port: don't crash when spawn with weapon is on and that weapon is a shield
This commit is contained in:
1 parent
a6e7d503e6
commit
f3757e75e9
2 files changed
+4
-2
No files matched your search
+2
-1
@@ -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);
|
||||
|
||||
+2
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user