diff --git a/src/p_setup.c b/src/p_setup.c index 435788c27..be96388ba 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -150,6 +150,8 @@ static SINT8 partadd_stage = -1; static boolean partadd_replacescurrentmap = false; static boolean partadd_important = false; +SINT8 midgamejoin = 0; + /** Logs an error about a map being corrupt, then terminate. * This allows reporting highly technical errors for usefulness, without * confusing a novice map designer who simply needs to run ZenNode. @@ -2587,6 +2589,7 @@ boolean P_SetupLevel(boolean skipprecip) INT32 i, loadprecip = 1, ranspecialwipe = 0; INT32 loademblems = 1; INT32 fromnetsave = 0; + midgamejoin = 0; sector_t *ss; boolean chase; @@ -2781,6 +2784,7 @@ boolean P_SetupLevel(boolean skipprecip) fromnetsave = 1; loadprecip = 0; loademblems = 0; + midgamejoin = 1; } // internal game map diff --git a/src/p_setup.h b/src/p_setup.h index 9e66fff81..9b96225ad 100644 --- a/src/p_setup.h +++ b/src/p_setup.h @@ -18,6 +18,8 @@ #include "doomstat.h" #include "r_defs.h" +extern SINT8 midgamejoin; + // map md5, sent to players via PT_SERVERINFO extern unsigned char mapmd5[16]; diff --git a/src/p_spec.c b/src/p_spec.c index ff88b2a3b..313329979 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4980,6 +4980,10 @@ void P_UpdateSpecials(void) // LEVEL TIMER P_CheckTimeLimit(); + // Dynamic slopeness + if (!midgamejoin) // run here when not joined midgame to prevent any potential issues that may arise + P_RunDynamicSlopes(); + // POINT LIMIT P_CheckPointLimit(); diff --git a/src/p_tick.c b/src/p_tick.c index 0ca311c6e..2d51b461a 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -18,6 +18,7 @@ #include "z_zone.h" #include "s_sound.h" #include "st_stuff.h" +#include "p_setup.h" #include "p_polyobj.h" #include "m_random.h" #include "lua_script.h" @@ -686,7 +687,8 @@ void P_Ticker(boolean run) if (run) { // Dynamic slopeness - P_RunDynamicSlopes(); + if (midgamejoin) // only run here if we joined midgame to fix some desynchs + P_RunDynamicSlopes(); PS_START_TIMING(ps_thinkertime); P_RunThinkers(); @@ -721,12 +723,6 @@ void P_Ticker(boolean run) if (!(modeattacking && !demo.playback) || leveltime >= starttime - TICRATE*4) timeinmap++; - /*if (G_TagGametype()) - P_DoTagStuff(); - - if (G_GametypeHasTeams()) - P_DoCTFStuff();*/ - if (run) { if (countdowntimer && --countdowntimer <= 0) @@ -905,7 +901,8 @@ void P_PreTicker(INT32 frames) } // Dynamic slopeness - P_RunDynamicSlopes(); + if (midgamejoin) + P_RunDynamicSlopes(); P_RunThinkers();