summaryrefslogtreecommitdiff
path: root/src/hexen/p_maputl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hexen/p_maputl.c')
-rw-r--r--src/hexen/p_maputl.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/hexen/p_maputl.c b/src/hexen/p_maputl.c
index 2067f8b5..762b9dbf 100644
--- a/src/hexen/p_maputl.c
+++ b/src/hexen/p_maputl.c
@@ -98,7 +98,7 @@ int P_PointOnLineSide(fixed_t x, fixed_t y, line_t * line)
int P_BoxOnLineSide(fixed_t * tmbox, line_t * ld)
{
- int p1, p2;
+ int p1 = 0, p2 = 0;
switch (ld->slopetype)
{
@@ -839,7 +839,8 @@ mobj_t *P_RoughMonsterSearch(mobj_t * mo, int distance)
if (startX >= 0 && startX < bmapwidth && startY >= 0
&& startY < bmapheight)
{
- if (target = RoughBlockCheck(mo, startY * bmapwidth + startX))
+ target = RoughBlockCheck(mo, startY * bmapwidth + startX);
+ if (target != NULL)
{ // found a target right away
return target;
}
@@ -892,7 +893,8 @@ mobj_t *P_RoughMonsterSearch(mobj_t * mo, int distance)
// Trace the first block section (along the top)
for (; blockIndex <= firstStop; blockIndex++)
{
- if (target = RoughBlockCheck(mo, blockIndex))
+ target = RoughBlockCheck(mo, blockIndex);
+ if (target != NULL)
{
return target;
}
@@ -900,7 +902,8 @@ mobj_t *P_RoughMonsterSearch(mobj_t * mo, int distance)
// Trace the second block section (right edge)
for (blockIndex--; blockIndex <= secondStop; blockIndex += bmapwidth)
{
- if (target = RoughBlockCheck(mo, blockIndex))
+ target = RoughBlockCheck(mo, blockIndex);
+ if (target != NULL)
{
return target;
}
@@ -908,7 +911,8 @@ mobj_t *P_RoughMonsterSearch(mobj_t * mo, int distance)
// Trace the third block section (bottom edge)
for (blockIndex -= bmapwidth; blockIndex >= thirdStop; blockIndex--)
{
- if (target = RoughBlockCheck(mo, blockIndex))
+ target = RoughBlockCheck(mo, blockIndex);
+ if (target != NULL)
{
return target;
}
@@ -916,7 +920,8 @@ mobj_t *P_RoughMonsterSearch(mobj_t * mo, int distance)
// Trace the final block section (left edge)
for (blockIndex++; blockIndex > finalStop; blockIndex -= bmapwidth)
{
- if (target = RoughBlockCheck(mo, blockIndex))
+ target = RoughBlockCheck(mo, blockIndex);
+ if (target != NULL)
{
return target;
}