From 1f5ce047ad6cb709f746b794b4a2dea9e2f89fb6 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Fri, 20 Feb 2015 00:03:15 -0500 Subject: Fix game code that makes false boolean assumptions. Various bits of code assume that booleans are represented as 32-bit ints and that they can be assigned to from 32-bit values. This isn't true on all systems; fix code that does this to convert to boolean values properly. This is more progress towards fixing #509. --- src/strife/p_inter.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/strife/p_inter.c') diff --git a/src/strife/p_inter.c b/src/strife/p_inter.c index 71db6fe1..f2e16efb 100644 --- a/src/strife/p_inter.c +++ b/src/strife/p_inter.c @@ -537,7 +537,7 @@ void P_TouchSpecialThing(mobj_t* special, mobj_t* toucher) // rifle case SPR_RIFL: - if(!P_GiveWeapon(player, wp_rifle, special->flags & MF_DROPPED)) + if(!P_GiveWeapon(player, wp_rifle, (special->flags & MF_DROPPED) != 0)) return; sound = sfx_wpnup; // haleyjd: SHK-CHK! break; @@ -560,7 +560,8 @@ void P_TouchSpecialThing(mobj_t* special, mobj_t* toucher) // grenade launcher case SPR_GRND: - if(!P_GiveWeapon(player, wp_hegrenade, special->flags & MF_DROPPED)) + if(!P_GiveWeapon(player, wp_hegrenade, + (special->flags & MF_DROPPED) != 0)) return; sound = sfx_wpnup; // haleyjd: SHK-CHK! break; @@ -574,14 +575,15 @@ void P_TouchSpecialThing(mobj_t* special, mobj_t* toucher) // electric bolt crossbow case SPR_CBOW: - if(!P_GiveWeapon(player, wp_elecbow, special->flags & MF_DROPPED)) + if(!P_GiveWeapon(player, wp_elecbow, + (special->flags & MF_DROPPED) != 0)) return; sound = sfx_wpnup; // haleyjd: SHK-CHK! break; // haleyjd 09/21/10: missed case: THE SIGIL! case SPR_SIGL: - if(!P_GiveWeapon(player, wp_sigil, special->flags & MF_DROPPED)) + if(!P_GiveWeapon(player, wp_sigil, (special->flags & MF_DROPPED) != 0)) { player->sigiltype = special->frame; return; -- cgit v1.2.3