From 758c77fe53a90a6013801f754bb083c851c99d8c Mon Sep 17 00:00:00 2001
From: RedEnchilada <red@lyrawearspants.com>
Date: Sat, 13 Aug 2016 17:43:22 -0500
Subject: [PATCH] Fixed non-players having fucked slope stepup/down

---
 src/p_map.c  | 8 ++++++--
 src/p_mobj.c | 6 ++----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/p_map.c b/src/p_map.c
index 1f2d903e80..2457360563 100644
--- a/src/p_map.c
+++ b/src/p_map.c
@@ -1970,8 +1970,12 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
 			}
 
 			// Ramp test
-			if (thing->player && maxstep > 0
-			&& !(P_PlayerTouchingSectorSpecial(thing->player, 1, 14) || GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1) == 14))
+			if (maxstep > 0 && !(
+				thing->player && (
+				P_PlayerTouchingSectorSpecial(thing->player, 1, 14)
+				|| GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1) == 14)
+				)
+			)
 			{
 				// If the floor difference is MAXSTEPMOVE or less, and the sector isn't Section1:14, ALWAYS
 				// step down! Formerly required a Section1:13 sector for the full MAXSTEPMOVE, but no more.
diff --git a/src/p_mobj.c b/src/p_mobj.c
index 62dee0a673..77dfd19233 100644
--- a/src/p_mobj.c
+++ b/src/p_mobj.c
@@ -1650,8 +1650,6 @@ void P_XYMovement(mobj_t *mo)
 	I_Assert(mo != NULL);
 	I_Assert(!P_MobjWasRemoved(mo));
 
-	moved = true;
-
 	// if it's stopped
 	if (!mo->momx && !mo->momy)
 	{
@@ -1708,9 +1706,9 @@ void P_XYMovement(mobj_t *mo)
 	if (!P_TryMove(mo, mo->x + xmove, mo->y + ymove, true) && !(mo->eflags & MFE_SPRUNG))
 	{
 		// blocked move
+		moved = false;
 
 		if (player) {
-			moved = false;
 			if (player->bot)
 				B_MoveBlocked(player);
 		}
@@ -1815,7 +1813,7 @@ void P_XYMovement(mobj_t *mo)
 		else
 			mo->momx = mo->momy = 0;
 	}
-	else if (player)
+	else
 		moved = true;
 
 	if (P_MobjWasRemoved(mo)) // MF_SPECIAL touched a player! O_o;;
-- 
GitLab