From 7c07f39019723c0784a6bea2f8df61f5e7432c47 Mon Sep 17 00:00:00 2001
From: Monster Iestyn <iestynjealous@ntlworld.com>
Date: Mon, 5 Dec 2016 22:07:16 +0000
Subject: [PATCH] Make sure flipped things placed directly on ceiling get
 MFE_ONGROUND

This fixes ceiling springs apparently flying down with you in various scenarios
---
 src/p_mobj.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/p_mobj.c b/src/p_mobj.c
index e7ec2f8b8..6a3ac9ee3 100644
--- a/src/p_mobj.c
+++ b/src/p_mobj.c
@@ -7685,6 +7685,10 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
 
 		if (mobj->type == MT_UNIDUS)
 			mobj->z -= FixedMul(mobj->info->mass, mobj->scale);
+
+		// defaults onground
+		if (mobj->z + mobj->height == mobj->ceilingz)
+			mobj->eflags |= MFE_ONGROUND;
 	}
 	else
 		mobj->z = z;
-- 
GitLab