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/doom/p_inter.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/doom/p_inter.c') diff --git a/src/doom/p_inter.c b/src/doom/p_inter.c index c9965799..633408fe 100644 --- a/src/doom/p_inter.c +++ b/src/doom/p_inter.c @@ -603,8 +603,9 @@ P_TouchSpecialThing break; case SPR_MGUN: - if (!P_GiveWeapon (player, wp_chaingun, special->flags&MF_DROPPED) ) - return; + if (!P_GiveWeapon(player, wp_chaingun, + (special->flags & MF_DROPPED) != 0)) + return; player->message = DEH_String(GOTCHAINGUN); sound = sfx_wpnup; break; @@ -631,15 +632,17 @@ P_TouchSpecialThing break; case SPR_SHOT: - if (!P_GiveWeapon (player, wp_shotgun, special->flags&MF_DROPPED ) ) - return; + if (!P_GiveWeapon(player, wp_shotgun, + (special->flags & MF_DROPPED) != 0)) + return; player->message = DEH_String(GOTSHOTGUN); sound = sfx_wpnup; break; case SPR_SGN2: - if (!P_GiveWeapon (player, wp_supershotgun, special->flags&MF_DROPPED ) ) - return; + if (!P_GiveWeapon(player, wp_supershotgun, + (special->flags & MF_DROPPED) != 0)) + return; player->message = DEH_String(GOTSHOTGUN2); sound = sfx_wpnup; break; -- cgit v1.2.3