From d7363ff87a7c3e70aa4a5a35bdca7b8435835165 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Fri, 1 May 2020 19:07:29 +0200 Subject: [PATCH] Implement linedef type that adds a raise thinker to an FOF --- extras/conf/udb/Includes/SRB222_linedefs.cfg | 25 ++++++++++++++++++++ src/p_spec.c | 21 ++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/extras/conf/udb/Includes/SRB222_linedefs.cfg b/extras/conf/udb/Includes/SRB222_linedefs.cfg index 53a82aa0a..a356a2df7 100644 --- a/extras/conf/udb/Includes/SRB222_linedefs.cfg +++ b/extras/conf/udb/Includes/SRB222_linedefs.cfg @@ -1916,6 +1916,31 @@ udmf enum = "yesno"; } } + + 260 + { + title = "Add Raise Thinker"; + prefix = "(260)"; + arg0 + { + title = "Control linedef tag"; + type = 15; + } + arg1 + { + title = "Speed"; + } + arg2 + { + title = "Destination height"; + } + arg3 + { + title = "Require spindash?"; + type = 11; + enum = "noyes"; + } + } } linedefexecmisc diff --git a/src/p_spec.c b/src/p_spec.c index 72b8ebbb4..128f84a73 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -6450,6 +6450,7 @@ void P_SpawnSpecials(boolean fromnetsave) switch (lines[i].special) { INT32 s; + INT32 l; size_t sec; ffloortype_e ffloorflags; @@ -6968,6 +6969,26 @@ void P_SpawnSpecials(boolean fromnetsave) I_Error("Custom FOF (tag %d) found without a linedef back side!", lines[i].tag); break; + case 260: // Add raise thinker to FOF + if (udmf) + { + fixed_t destheight = lines[i].args[2] << FRACBITS; + fixed_t startheight, topheight, bottomheight; + + for (l = -1; (l = P_FindLineFromTag(lines[i].args[0], l)) >= 0 ;) + { + if (lines[l].special < 100 || lines[l].special >= 300) + continue; + + startheight = lines[l].frontsector->ceilingheight; + topheight = max(startheight, destheight); + bottomheight = min(startheight, destheight); + + P_AddRaiseThinker(lines[l].frontsector, lines[l].args[0], lines[i].args[1] << FRACBITS, topheight, bottomheight, (destheight < startheight), !!(lines[i].args[3])); + } + } + break; + case 300: // Linedef executor (combines with sector special 974/975) and commands case 302: case 303: