From f7d1515888ace7e637635714e6cfa0ccae7a3ca5 Mon Sep 17 00:00:00 2001 From: Nev3r Date: Thu, 18 Apr 2019 14:43:34 +0200 Subject: [PATCH] Perform dynamic slope thinking before other thinkers. Signed-off-by: Nev3r --- src/p_slopes.h | 12 +++++++----- src/p_spec.c | 5 ----- src/p_tick.c | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/p_slopes.h b/src/p_slopes.h index b802ec25f..56f5d6187 100644 --- a/src/p_slopes.h +++ b/src/p_slopes.h @@ -10,9 +10,6 @@ /// \file p_slopes.c /// \brief ZDoom + Eternity Engine Slopes, ported and enhanced by Kalaron -#ifndef P_SLOPES_H__ -#define P_SLOPES_H__ - #ifdef ESLOPE void P_CalculateSlopeNormal(pslope_t *slope); void P_ResetDynamicSlopes(void); @@ -42,7 +39,12 @@ fixed_t P_GetWallTransferMomZ(mobj_t *mo, pslope_t *slope); void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope); void P_ButteredSlope(mobj_t *mo); -#endif +/// Permit slopes to be dynamically altered. +typedef struct +{ + thinker_t thinker; + pslope_t* slope; +} dynplanethink_t; -// EOF +void T_DynamicSlope (dynplanethink_t* th); #endif // #ifdef ESLOPE diff --git a/src/p_spec.c b/src/p_spec.c index 44edec870..731a80074 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5558,11 +5558,6 @@ void P_UpdateSpecials(void) // POINT LIMIT P_CheckPointLimit(); -#ifdef ESLOPE - // Dynamic slopeness - P_RunDynamicSlopes(); -#endif - // ANIMATE TEXTURES for (anim = anims; anim < lastanim; anim++) { diff --git a/src/p_tick.c b/src/p_tick.c index 6f7c96ead..a32fa0029 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -25,6 +25,11 @@ // Object place #include "m_cheat.h" +#ifdef ESLOPE +// Dynamic slopes +#include "p_slopes.h" +#endif + tic_t leveltime; // @@ -609,6 +614,11 @@ void P_Ticker(boolean run) if (run) { + #ifdef ESLOPE + // Dynamic slopeness + P_RunDynamicSlopes(); + #endif + P_RunThinkers(); // Run any "after all the other thinkers" stuff @@ -724,6 +734,11 @@ void P_PreTicker(INT32 frames) memcpy(&players[i].cmd, &temptic, sizeof(ticcmd_t)); } +#ifdef ESLOPE + // Dynamic slopeness + P_RunDynamicSlopes(); +#endif + P_RunThinkers(); // Run any "after all the other thinkers" stuff