diff --git a/src/p_setup.c b/src/p_setup.c index fbfde84a0..30f995588 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. @@ -2704,6 +2706,7 @@ boolean P_SetupLevel(boolean skipprecip) INT32 i, loadprecip = 1, ranspecialwipe = 0; INT32 loademblems = 1; INT32 fromnetsave = 0; + midgamejoin = 0; boolean loadedbm = false; sector_t *ss; boolean chase; @@ -2903,6 +2906,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 4923a9f6e..d05f9fe74 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4977,6 +4977,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 379451a92..3913c5d62 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" @@ -680,7 +681,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(); @@ -715,12 +717,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) @@ -899,7 +895,8 @@ void P_PreTicker(INT32 frames) } // Dynamic slopeness - P_RunDynamicSlopes(); + if (midgamejoin) + P_RunDynamicSlopes(); P_RunThinkers();