foxygit / doom Log in
commit 21f21427c16074276aef29d1d3b1238763d06b77
Author:     James Haley <haleyjd@hotmail.com>
AuthorDate: Fri Sep 10 18:17:34 2010 +0000
Commit:     James Haley <haleyjd@hotmail.com>
CommitDate: Fri Sep 10 18:17:34 2010 +0000

    Minor reformatting in p_map.c, and found some code hex-rays was ignoring
    in P_CheckMissileRange regarding maximum considered distance for
    Crusaders.

    Subversion-branch: /branches/strife-branch
    Subversion-revision: 2058
---
 src/strife/p_enemy.c |  4 ++++
 src/strife/p_map.c   | 50 +++++++++++++++++++++++++-------------------------
 2 files changed, 29 insertions(+), 25 deletions(-)

diff --git a/src/strife/p_enemy.c b/src/strife/p_enemy.c
index a5d3da3c..f6c44c67 100644
--- a/src/strife/p_enemy.c
+++ b/src/strife/p_enemy.c
@@ -346,6 +346,10 @@ boolean P_CheckMissileRange(mobj_t* actor)
     if (dist > 150)
         dist = 150;

+    // haleyjd 09/10/10: Hex-Rays was leaving this out completely:
+    if (actor->type == MT_CRUSADER && dist > 120)
+        dist = 120;
+
     if (P_Random () < dist)
         return false;

diff --git a/src/strife/p_map.c b/src/strife/p_map.c
index f31cbf86..0aeeb996 100644
--- a/src/strife/p_map.c
+++ b/src/strife/p_map.c
@@ -525,18 +525,18 @@ P_TryMove

     floatok = false;
     if (!P_CheckPosition (thing, x, y))
-	return false;		// solid wall or thing
-
+        return false;		// solid wall or thing
+
     if ( !(thing->flags & MF_NOCLIP) )
     {
-	if (tmceilingz - tmfloorz < thing->height)
-	    return false;	// doesn't fit
+        if (tmceilingz - tmfloorz < thing->height)
+            return false;	// doesn't fit

-	floatok = true;
-
-	if ( /*!(thing->flags&MF_TELEPORT)  // villsa [STRIFE] unused
-	     &&*/tmceilingz - thing->z < thing->height)
-	    return false;	// mobj must lower itself to fit
+        floatok = true;
+
+        // villsa [STRIFE] Removed MF_TELEPORT
+        if (tmceilingz - thing->z < thing->height)
+            return false;	// mobj must lower itself to fit

         // villsa [STRIFE] non-robots are limited to 16 unit step height
         if(!(thing->flags & MF_NOBLOOD) && tmfloorz - thing->z > (16*FRACUNIT) ||
@@ -547,9 +547,9 @@ P_TryMove
         if(thing->flags & MF_MISSILE && tmfloorz - thing->z > (4*FRACUNIT))
             return false;

-	if ( !(thing->flags&(MF_DROPOFF|MF_FLOAT))
-	     && tmfloorz - tmdropoffz > 24*FRACUNIT )
-	    return false;	// don't stand over a dropoff
+        if ( !(thing->flags&(MF_DROPOFF|MF_FLOAT))
+            && tmfloorz - tmdropoffz > 24*FRACUNIT )
+            return false;	// don't stand over a dropoff
     }

     // the move is ok,
@@ -566,20 +566,20 @@ P_TryMove
     P_SetThingPosition (thing);

     // if any special lines were hit, do the effect
-    if (! (thing->flags&(/*MF_TELEPORT|*/MF_NOCLIP)) ) // villsa [STRIFE] MF_TELEPORT not used
+    if (! (thing->flags&MF_NOCLIP) ) // villsa [STRIFE] MF_TELEPORT not used
     {
-	while (numspechit--)
-	{
-	    // see if the line was crossed
-	    ld = spechit[numspechit];
-	    side = P_PointOnLineSide (thing->x, thing->y, ld);
-	    oldside = P_PointOnLineSide (oldx, oldy, ld);
-	    if (side != oldside)
-	    {
-		if (ld->special)
-		    P_CrossSpecialLine (ld-lines, oldside, thing);
-	    }
-	}
+        while (numspechit--)
+        {
+            // see if the line was crossed
+            ld = spechit[numspechit];
+            side = P_PointOnLineSide (thing->x, thing->y, ld);
+            oldside = P_PointOnLineSide (oldx, oldy, ld);
+            if (side != oldside)
+            {
+                if (ld->special)
+                    P_CrossSpecialLine (ld-lines, oldside, thing);
+            }
+        }
     }

     return true;