From a8ac5a992220732b39c85341004168268402914b Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 10 Oct 2022 07:00:08 -0400 Subject: [PATCH] Make Kart Z FOF Thwomp delay use args --- src/p_floor.c | 16 ++++++++++------ src/p_saveg.c | 1 + src/p_setup.c | 2 ++ src/p_spec.c | 1 + src/p_spec.h | 1 + 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/p_floor.c b/src/p_floor.c index b394ab811..268c289cc 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1058,14 +1058,18 @@ void T_ThwompSector(thwomp_t *thwomp) INT32 secnum; fixed_t speed; + if (thwompsactive == false) + { + // Ring Racers: Rest until Lap 2 + return; + } + // SRB2kart 170217 - Thwomps are automatic. // Put up a timer before you start falling down. - // I could of used rowoffset, but the FOF actually - // modifies the textures's Y offset. It doesn't with - // textureoffset, so Effect 4 can be ignored as usual. - if ((thwomp->sourceline->flags & ML_SKEWTD) // FIXME: UDMFify - && leveltime < (unsigned)(sides[thwomp->sourceline->sidenum[0]].textureoffset>>FRACBITS)) - thwomp->direction = 0; + if (--thwomp->initDelay > 0) + { + return; + } // If you just crashed down, wait a second before coming back up. if (--thwomp->delay > 0) diff --git a/src/p_saveg.c b/src/p_saveg.c index 105ab1a74..ce9902833 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -2259,6 +2259,7 @@ static void SaveThwompThinker(const thinker_t *th, const UINT8 type) WRITEINT32(save_p, ht->delay); WRITEINT16(save_p, ht->tag); WRITEUINT16(save_p, ht->sound); + WRITEINT32(save_p, ht->initDelay); } static void SaveFloatThinker(const thinker_t *th, const UINT8 type) diff --git a/src/p_setup.c b/src/p_setup.c index 49d14d65e..ea406559c 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -4529,6 +4529,8 @@ static void P_ConvertBinaryLinedefTypes(void) } if (lines[i].flags & ML_MIDSOLID) P_WriteConstant(sides[lines[i].sidenum[0]].textureoffset >> FRACBITS, &lines[i].stringargs[0]); + if (lines[i].flags & ML_SKEWTD) // Kart Z delay. Yes, it used the same field as the above. + lines[i].args[3] = (unsigned)(sides[lines[i].sidenum[0]].textureoffset >> FRACBITS); break; case 252: //FOF: Shatter block case 253: //FOF: Shatter block, translucent diff --git a/src/p_spec.c b/src/p_spec.c index 835091c07..0b7eada6b 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5469,6 +5469,7 @@ static inline void P_AddThwompThinker(sector_t *sec, line_t *sourceline, fixed_t thwomp->delay = 1; thwomp->tag = sourceline->args[0]; thwomp->sound = sound; + thwomp->initDelay = sourceline->args[3]; sec->floordata = thwomp; sec->ceilingdata = thwomp; diff --git a/src/p_spec.h b/src/p_spec.h index 08aa6016b..33ecd0b4e 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -848,6 +848,7 @@ typedef struct INT32 delay; INT16 tag; UINT16 sound; + INT32 initDelay; } thwomp_t; typedef struct