Adapt linedef type 457 to UDMF

This commit is contained in:
MascaraSnake 2021-09-21 15:10:50 +02:00
parent d8b5cb6c90
commit 132f3f21f1
3 changed files with 49 additions and 9 deletions

View file

@ -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";

View file

@ -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;

View file

@ -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;