From 099cea0a19c95cf94868f91258f1ff59521788f6 Mon Sep 17 00:00:00 2001 From: MascaraSnake <jonassauer27@gmail.com> Date: Sun, 27 Jun 2021 11:56:06 +0200 Subject: [PATCH] Implement "set flats" linedef type --- extras/conf/SRB2-22.cfg | 8 +++++++ extras/conf/udb/Includes/SRB222_linedefs.cfg | 22 ++++++++++++++++++++ src/p_setup.c | 14 +++++++++++++ src/p_spec.c | 12 +++++++++++ 4 files changed, 56 insertions(+) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index f457fe9721..4678563440 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -2009,6 +2009,14 @@ linedeftypes flags8text = "[3] Set delay by backside sector"; } + 408 + { + title = "Set Tagged Sector's Flats"; + prefix = "(408)"; + flags64text = "[6] Don't set floor flat"; + flags512text = "[9] Don't set ceiling flat"; + } + 409 { title = "Change Tagged Sector's Tag"; diff --git a/extras/conf/udb/Includes/SRB222_linedefs.cfg b/extras/conf/udb/Includes/SRB222_linedefs.cfg index 4cf3159e25..0e110cfb6c 100644 --- a/extras/conf/udb/Includes/SRB222_linedefs.cfg +++ b/extras/conf/udb/Includes/SRB222_linedefs.cfg @@ -765,6 +765,11 @@ doom title = "Set Tagged Sector's Light Level"; prefix = "(402)"; } + 408 + { + title = "Set Tagged Sector's Flats"; + prefix = "(408)"; + } 409 { title = "Change Tagged Sector's Tag"; @@ -2448,6 +2453,23 @@ udmf } } } + + 408 + { + title = "Set Tagged Sector's Flats"; + prefix = "(408)"; + arg0 + { + title = "Target sector tag"; + type = 13; + } + arg1 + { + title = "Affected planes"; + type = 11; + enum = "floorceiling"; + } + } } linedefexecplane diff --git a/src/p_setup.c b/src/p_setup.c index 9c1a2d68cf..56c3ed78ba 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3570,6 +3570,20 @@ static void P_ConvertBinaryMap(void) lines[i].args[4] = !!(lines[i].flags & ML_NOCLIMB); lines[i].special = 405; break; + case 408: //Set flats + lines[i].args[0] = tag; + if ((lines[i].flags & (ML_NOCLIMB|ML_EFFECT4)) == (ML_NOCLIMB|ML_EFFECT4)) + { + CONS_Alert(CONS_WARNING, M_GetText("Set flats linedef (tag %d) doesn't have anything to do.\nConsider changing the linedef's flag configuration or removing it entirely.\n"), tag); + lines[i].special = 0; + } + else if (lines[i].flags & ML_NOCLIMB) + lines[i].args[1] = 1; + else if (lines[i].flags & ML_EFFECT4) + lines[i].args[1] = 0; + else + lines[i].args[1] = 2; + break; case 411: //Stop plane movement lines[i].args[0] = tag; break; diff --git a/src/p_spec.c b/src/p_spec.c index 723b71b9bd..66071d9c62 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2284,6 +2284,18 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) EV_DoCeiling(line->args[0], line, moveCeilingByDistance); break; + case 408: // Set flats + { + TAG_ITER_SECTORS(line->args[0], secnum) + { + if (line->args[1] != 1) + sectors[secnum].floorpic = line->frontsector->floorpic; + if (line->args[1] != 0) + sectors[secnum].ceilingpic = line->frontsector->ceilingpic; + } + break; + } + case 409: // Change tagged sectors' tag // (formerly "Change calling sectors' tag", but behavior was changed) { -- GitLab