diff --git a/src/p_slopes.c b/src/p_slopes.c
index 7fa51452ec5ec220c834c6ba79afbe91a6ae6bbc..6048f478d63f8ddc278df3f4d6b542c4de28ab42 100644
--- a/src/p_slopes.c
+++ b/src/p_slopes.c
@@ -94,10 +94,14 @@ static void ReconfigureViaVertexes (pslope_t *slope, const vector3_t v1, const v
 static void ReconfigureViaConstants (pslope_t *slope, const fixed_t a, const fixed_t b, const fixed_t c, const fixed_t d)
 {
 	fixed_t m;
+	fixed_t o = 0;
 	vector3_t *normal = &slope->normal;
 
+	if (c)
+		o = abs(c) <= FRACUNIT ? -FixedMul(d, FixedDiv(FRACUNIT, c)) : -FixedDiv(d, c);
+
 	// Set origin.
-	FV3_Load(&slope->o, 0, 0, c ? -FixedDiv(d, c) : 0);
+	FV3_Load(&slope->o, 0, 0, o);
 
 	// Get slope's normal.
 	FV3_Load(normal, a, b, c);