Implement "set flats" linedef type

This commit is contained in:
MascaraSnake 2021-06-27 11:56:06 +02:00
parent 13eb4cb359
commit 099cea0a19
4 changed files with 56 additions and 0 deletions

View file

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

View file

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

View file

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

View file

@ -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)
{