From 132f3f21f1006de7855c3c75577266ec835369bd Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Tue, 21 Sep 2021 15:10:50 +0200 Subject: [PATCH] Adapt linedef type 457 to UDMF --- extras/conf/udb/Includes/SRB222_linedefs.cfg | 37 ++++++++++++++++++++ src/p_setup.c | 7 ++++ src/p_spec.c | 14 +++----- 3 files changed, 49 insertions(+), 9 deletions(-) diff --git a/extras/conf/udb/Includes/SRB222_linedefs.cfg b/extras/conf/udb/Includes/SRB222_linedefs.cfg index ffda8082a..cf81b56dd 100644 --- a/extras/conf/udb/Includes/SRB222_linedefs.cfg +++ b/extras/conf/udb/Includes/SRB222_linedefs.cfg @@ -3083,6 +3083,43 @@ udmf } } + 457 + { + title = "Track Object's Angle"; + prefix = "(457)"; + arg0 + { + title = "Anchor tag"; + type = 14; + } + arg1 + { + title = "Angle tolerance"; + type = 8; + } + arg2 + { + title = "Time tolerance"; + } + arg3 + { + title = "Trigger linedef tag"; + type = 15; + } + arg4 + { + title = "Track after failure?"; + type = 11; + enum = "noyes"; + } + } + + 458 + { + title = "Stop Tracking Object's Angle"; + prefix = "(458)"; + } + 460 { title = "Award Rings"; diff --git a/src/p_setup.c b/src/p_setup.c index 1e3581ce7..8e9d73e4b 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -4066,6 +4066,13 @@ static void P_ConvertBinaryMap(void) case 456: //Stop fading colormap lines[i].args[0] = Tag_FGet(&lines[i].tags); break; + case 457: //Track object's angle + lines[i].args[0] = tag; + lines[i].args[1] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS; + lines[i].args[2] = sides[lines[i].sidenum[0]].rowoffset >> FRACBITS; + lines[i].args[3] = (lines[i].sidenum[1] != 0xffff) ? sides[lines[i].sidenum[1]].rowoffset >> FRACBITS : 0; + lines[i].args[4] = !!(lines[i].flags & ML_EFFECT2); + break; case 459: //Control text prompt lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS; lines[i].args[1] = sides[lines[i].sidenum[0]].rowoffset >> FRACBITS; diff --git a/src/p_spec.c b/src/p_spec.c index a00f2c094..57f9237dc 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3488,17 +3488,13 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) case 457: // Track mobj angle to point if (mo) { - INT32 failureangle = FixedAngle((min(max(abs(sides[line->sidenum[0]].textureoffset>>FRACBITS), 0), 360))*FRACUNIT); - INT32 failuredelay = abs(sides[line->sidenum[0]].rowoffset>>FRACBITS); - INT32 failureexectag = line->sidenum[1] != 0xffff ? - (INT32)(sides[line->sidenum[1]].textureoffset>>FRACBITS) : 0; - boolean persist = (line->flags & ML_EFFECT2); + INT32 failureangle = FixedAngle((min(max(abs(line->args[1]), 0), 360))*FRACUNIT); + INT32 failuredelay = abs(line->args[2]); + INT32 failureexectag = line->args[3]; + boolean persist = !!(line->args[4]); mobj_t *anchormo; - if ((secnum = Tag_Iterate_Sectors(tag, 0)) < 0) - return; - - anchormo = P_GetObjectTypeInSectorNum(MT_ANGLEMAN, secnum); + anchormo = P_FindObjectTypeFromTag(MT_ANGLEMAN, line->args[0]); if (!anchormo) return;