From 213a9632ca4b5cd68902bc805cc625d5b24d3e41 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 2 Jun 2016 16:09:33 +0100 Subject: [PATCH] Let's multiply the thrust by the mobj's friction. You should have less chance of purchase on a slippery slope (tee hee) and more on a rough one, but the slopes were basically identical during testing before I implemented this change. --- src/p_slopes.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/p_slopes.c b/src/p_slopes.c index 72abf02bb..ec07ab2fe 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -864,8 +864,6 @@ void P_ButteredSlope(mobj_t *mo) mult = FINECOSINE(angle >> ANGLETOFINESHIFT); } - //CONS_Printf("%d\n", mult); - thrust = FixedMul(thrust, FRACUNIT*2/3 + mult/8); } @@ -873,11 +871,18 @@ void P_ButteredSlope(mobj_t *mo) thrust = FixedMul(thrust, FRACUNIT+P_AproxDistance(mo->momx, mo->momy)/16); // This makes it harder to zigzag up steep slopes, as well as allows greater top speed when rolling down - // Multiply by gravity - thrust = FixedMul(thrust, FixedMul(gravity, abs(P_GetMobjGravity(mo)))); // Now uses the absolute of mobj gravity. You're welcome. - // Multiply by scale (gravity strength depends on mobj scale) + // The strength of gravity depends on the global gravity base setting... + thrust = FixedMul(thrust, gravity); + + // ...the sector-based gravity strength... + thrust = FixedMul(thrust, abs(P_GetMobjGravity(mo))); + + // ...and the scale of the object. thrust = FixedMul(thrust, mo->scale); + // Let's also multiply by friction for good measure. + thrust = FixedMul(thrust, mo->friction); + P_Thrust(mo, mo->standingslope->xydirection, thrust); }