From 3cad7398f009c28e3f9c95bdd468e46eaa93d78c Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 25 Sep 2020 13:32:14 -0700 Subject: [PATCH] Fix slope spawning; let polyobjects spawn again Move P_SpawnMapThings before P_SpawnSpecialsThatRequireObjects. Do not remove special from lines with ML_NETONLY or ML_NONET until after slopes are spawned. --- src/p_setup.c | 5 +-- src/p_spec.c | 86 ++++++++++++++++++++++++++++++--------------------- src/p_spec.h | 2 +- 3 files changed, 55 insertions(+), 38 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 9b8697b50..f49272582 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3986,11 +3986,12 @@ boolean P_LoadLevel(boolean fromnetsave) P_SpawnSlopes(fromnetsave); - P_RaiseThings(); + P_SpawnSpecialsAfterSlopes(); + + P_SpawnMapThings(!fromnetsave); P_SpawnSpecialsThatRequireObjects(); - P_SpawnMapThings(!fromnetsave); skyboxmo[0] = skyboxviewpnts[0]; skyboxmo[1] = skyboxcenterpnts[0]; diff --git a/src/p_spec.c b/src/p_spec.c index 01554060e..493a5554d 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5545,26 +5545,6 @@ P_RaiseTaggedThingsToFakeFloor ( } } -void -P_RaiseThings (void) -{ - size_t i; - - for (i = 0; i < numlines; ++i) - { - switch (lines[i].special) - { - case 80: // Raise tagged things by type to this FOF - P_RaiseTaggedThingsToFakeFloor( - ( sides[lines[i].sidenum[0]].textureoffset >> FRACBITS ), - lines[i].tag, - lines[i].frontsector - ); - break; - } - } -} - // // SPECIAL SPAWNING // @@ -5953,6 +5933,26 @@ static void P_ApplyFlatAlignment(line_t *master, sector_t *sector, angle_t flata } } +static boolean P_IsLineDisabled (const line_t * line) +{ + if (line->special != 7) // This is a hack. I can at least hope nobody wants to prevent flat alignment in netgames... + { + if (netgame || multiplayer) + { + if (line->flags & ML_NONET) + { + return true; + } + } + else if (line->flags & ML_NETONLY) + { + return true; + } + } + + return false; +} + /** After the map has loaded, scans for specials that spawn 3Dfloors and * thinkers. * @@ -5973,6 +5973,8 @@ void P_SpawnSpecials(boolean fromnetsave) // but currently isn't. (void)fromnetsave; + CONS_Printf("%d\n", sectors[11].floorheight); + // yep, we do this here - "bossdisabled" is considered an apparatus of specials. bossdisabled = 0; stoppedclock = false; @@ -6070,22 +6072,9 @@ void P_SpawnSpecials(boolean fromnetsave) // Init line EFFECTs for (i = 0; i < numlines; i++) { - if (lines[i].special != 7) // This is a hack. I can at least hope nobody wants to prevent flat alignment in netgames... + if (P_IsLineDisabled(&lines[i])) { - // set line specials to 0 here too, same reason as above - if (netgame || multiplayer) - { - if (lines[i].flags & ML_NONET) - { - lines[i].special = 0; - continue; - } - } - else if (lines[i].flags & ML_NETONLY) - { - lines[i].special = 0; - continue; - } + continue; } switch (lines[i].special) @@ -6987,6 +6976,33 @@ void P_SpawnSpecialsThatRequireObjects(void) P_RunLevelLoadExecutors(); } +/** Fuck ML_NONET + */ +void P_SpawnSpecialsAfterSlopes(void) +{ + size_t i; + + for (i = 0; i < numlines; ++i) + { + if (P_IsLineDisabled(&lines[i])) + { + /* remove the special so it can't even be found during the level */ + lines[i].special = 0; + } + + switch (lines[i].special) + { + case 80: // Raise tagged things by type to this FOF + P_RaiseTaggedThingsToFakeFloor( + ( sides[lines[i].sidenum[0]].textureoffset >> FRACBITS ), + lines[i].tag, + lines[i].frontsector + ); + break; + } + } +} + /** Adds 3Dfloors as appropriate based on a common control linedef. * * \param line Control linedef to use. diff --git a/src/p_spec.h b/src/p_spec.h index 10cc302f7..f2a245bb7 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -43,7 +43,7 @@ void P_SetupLevelFlatAnims(void); // at map load void P_InitSpecials(void); void P_SpawnSpecials(boolean fromnetsave); -void P_RaiseThings(void); +void P_SpawnSpecialsAfterSlopes(void); void P_SpawnSpecialsThatRequireObjects(void); // every tic