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/hexen/p_map.c | 2 +- src/hexen/p_maputl.c | 2 +- src/hexen/p_spec.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/hexen') diff --git a/src/hexen/p_map.c b/src/hexen/p_map.c index 11aa23e0..b1c542ca 100644 --- a/src/hexen/p_map.c +++ b/src/hexen/p_map.c @@ -661,7 +661,7 @@ boolean PIT_CheckThing(mobj_t * thing) // Check for special thing if (thing->flags & MF_SPECIAL) { - solid = thing->flags & MF_SOLID; + solid = (thing->flags & MF_SOLID) != 0; if (tmflags & MF_PICKUP) { // Can be picked up by tmthing P_TouchSpecialThing(thing, tmthing); // Can remove thing diff --git a/src/hexen/p_maputl.c b/src/hexen/p_maputl.c index a48ea8fa..dcc7d5d2 100644 --- a/src/hexen/p_maputl.c +++ b/src/hexen/p_maputl.c @@ -699,7 +699,7 @@ boolean P_PathTraverse(fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2, int mapx, mapy, mapxstep, mapystep; int count; - earlyout = flags & PT_EARLYOUT; + earlyout = (flags & PT_EARLYOUT) != 0; validcount++; intercept_p = intercepts; diff --git a/src/hexen/p_spec.c b/src/hexen/p_spec.c index e2069fb9..d36d3e86 100644 --- a/src/hexen/p_spec.c +++ b/src/hexen/p_spec.c @@ -864,7 +864,7 @@ boolean P_ActivateLine(line_t * line, mobj_t * mo, int side, if (line->flags & ML_SECRET) return false; // never open secret doors } - repeat = line->flags & ML_REPEAT_SPECIAL; + repeat = (line->flags & ML_REPEAT_SPECIAL) != 0; buttonSuccess = false; // Construct args[] array to contain the arguments from the line, as we -- cgit v1.2.3