Skip to content

Some slope improvements/fixes (plus P_GetMobjGravity)

toaster requested to merge toast_slopes into next

Dear Red, I did some things.

  • Made the slope flag SL_NOPHYSICS actually have an effect like we wanted to, but didn't get around to implementing yet - activated by setting the slope's linedef flags to have ML_NOSONIC.
  • Made downhill slope thrusts proportional to an object's gravity and friction.
  • To make the above happen - seperated out the gravity value finding code in P_CheckGravity into a seperate function, P_GetMobjGravity. (p_mobj.c, p_local.h) I also made this function available to Lua.
  • Turned those PANIC n console messages (which would inevitably be followed up with a crash, since we're accessing invalid memory immediately after) into a descriptive I_Error.
  • Put the SRB2CB type-shimming behind an ESLOPE_TYPESHIM ifdef.
  • Removed SPRINGCLEAN-ifdef'd code.
  • Cleaned up some eosteric comments.
  • NEW SINCE RED +1'd THIS: The teetering code now takes slopes into account pretty well. There are edge circumstances as outlined in commit 9d221f4f, but this is unilaterally better behaviour in every way and the teetering code was kind of a mess anyways.
  • NEW SINCE RED AND ALAM +1'd THIS: P_ReverseQuantiseMomentumToSlope. Simple function that replaces the inverse angle stuff (which also wasn't using InvAngle, just ANGLE_MAX - angle - which is inaccurate!!)

Current testing files available at /toaster/slptst3.wad and /toaster/gravitytest.lua on the ftp.

I want to do more to the branch like implement SL_ANCHORVERTEX in the near future, but this is probably safe to merge in its current state.

Merge request reports

Loading