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.

This commit is contained in:
toasterbabe 2016-06-02 16:09:33 +01:00
parent 80fceafcb9
commit 213a9632ca

View file

@ -864,8 +864,6 @@ void P_ButteredSlope(mobj_t *mo)
mult = FINECOSINE(angle >> ANGLETOFINESHIFT); mult = FINECOSINE(angle >> ANGLETOFINESHIFT);
} }
//CONS_Printf("%d\n", mult);
thrust = FixedMul(thrust, FRACUNIT*2/3 + mult/8); 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); 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 // This makes it harder to zigzag up steep slopes, as well as allows greater top speed when rolling down
// Multiply by gravity // The strength of gravity depends on the global gravity base setting...
thrust = FixedMul(thrust, FixedMul(gravity, abs(P_GetMobjGravity(mo)))); // Now uses the absolute of mobj gravity. You're welcome. thrust = FixedMul(thrust, gravity);
// Multiply by scale (gravity strength depends on mobj scale)
// ...the sector-based gravity strength...
thrust = FixedMul(thrust, abs(P_GetMobjGravity(mo)));
// ...and the scale of the object.
thrust = FixedMul(thrust, mo->scale); 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); P_Thrust(mo, mo->standingslope->xydirection, thrust);
} }