Adapt polyobject waving flag linedef to UDMF

This commit is contained in:
MascaraSnake 2021-07-04 14:10:11 +02:00
parent 5c2ce62f00
commit 429c6588af
3 changed files with 27 additions and 3 deletions

View file

@ -1569,6 +1569,25 @@ udmf
type = 15;
}
}
30
{
title = "Waving Flag";
prefix = "(30)";
arg0
{
title = "PolyObject ID";
type = 14;
}
arg1
{
title = "Speed";
}
arg2
{
title = "Distance";
}
}
}
planemove

View file

@ -3081,6 +3081,11 @@ static void P_ConvertBinaryMap(void)
break;
}
case 30: //Polyobject - waving flag
lines[i].args[0] = tag;
lines[i].args[1] = P_AproxDistance(lines[i].dx, lines[i].dy) >> FRACBITS;
lines[i].args[2] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
break;
case 50: //Instantly lower floor on level load
case 51: //Instantly raise ceiling on level load
lines[i].args[0] = tag;

View file

@ -1189,10 +1189,10 @@ static boolean PolyFlag(line_t *line)
{
polyflagdata_t pfd;
pfd.polyObjNum = Tag_FGet(&line->tags);
pfd.speed = P_AproxDistance(line->dx, line->dy) >> FRACBITS;
pfd.polyObjNum = line->args[0];
pfd.speed = line->args[1];
pfd.angle = R_PointToAngle2(line->v1->x, line->v1->y, line->v2->x, line->v2->y) >> ANGLETOFINESHIFT;
pfd.momx = sides[line->sidenum[0]].textureoffset >> FRACBITS;
pfd.momx = line->args[2];
return EV_DoPolyObjFlag(&pfd);
}