From 2afea367cb6dd222a381f24d36e60367178dfd09 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sat, 8 Oct 2022 11:06:14 +0200 Subject: [PATCH 1/2] Apply flipspecial automatically to ceiling carry effects --- src/p_spec.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/p_spec.c b/src/p_spec.c index 3883ea265..d56701634 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -7474,6 +7474,17 @@ void T_Scroll(scroll_t *s) } // end of switch } +static boolean IsSector3DBlock(sector_t* sec) +{ + size_t i; + for (i = 0; i < sec->linecount; i++) + { + if (sec->lines[i]->special >= 100 && sec->lines[i]->special < 300) + return true; + } + return false; +} + /** Adds a generalized scroller to the thinker list. * * \param type The enumerated type of scrolling. @@ -7487,6 +7498,7 @@ void T_Scroll(scroll_t *s) */ static void Add_Scroller(INT32 type, fixed_t dx, fixed_t dy, INT32 control, INT32 affectee, INT32 accel, INT32 exclusive) { + boolean is3dblock = IsSector3DBlock(§ors[affectee]); scroll_t *s = Z_Calloc(sizeof *s, PU_LEVSPEC, NULL); s->thinker.function.acp1 = (actionf_p1)T_Scroll; s->type = type; @@ -7500,7 +7512,13 @@ static void Add_Scroller(INT32 type, fixed_t dx, fixed_t dy, INT32 control, INT3 s->last_height = sectors[control].floorheight + sectors[control].ceilingheight; s->affectee = affectee; if (type == sc_carry || type == sc_carry_ceiling) + { sectors[affectee].specialflags |= SSF_CONVEYOR; + if ((type == sc_carry_ceiling) ^ is3dblock) + sectors[affectee].flags |= MSF_FLIPSPECIAL_CEILING; + else + sectors[affectee].flags |= MSF_FLIPSPECIAL_FLOOR; + } P_AddThinker(THINK_MAIN, &s->thinker); } From 979bc471baea7798b9914dcaeda141cc277cd7bf Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 9 Oct 2022 15:27:07 +0200 Subject: [PATCH 2/2] Conveyor belts: Only apply flipspecial if it's a 3D floor --- src/p_spec.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index d56701634..b9343b4de 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -7514,10 +7514,13 @@ static void Add_Scroller(INT32 type, fixed_t dx, fixed_t dy, INT32 control, INT3 if (type == sc_carry || type == sc_carry_ceiling) { sectors[affectee].specialflags |= SSF_CONVEYOR; - if ((type == sc_carry_ceiling) ^ is3dblock) - sectors[affectee].flags |= MSF_FLIPSPECIAL_CEILING; - else - sectors[affectee].flags |= MSF_FLIPSPECIAL_FLOOR; + if (is3dblock) + { + if (type == sc_carry) + sectors[affectee].flags |= MSF_FLIPSPECIAL_CEILING; + else + sectors[affectee].flags |= MSF_FLIPSPECIAL_FLOOR; + } } P_AddThinker(THINK_MAIN, &s->thinker); }