Now that set flats linedef exists, simplify set heights linedef

This commit is contained in:
MascaraSnake 2021-06-27 12:21:26 +02:00
parent 099cea0a19
commit 2da5b54e73
5 changed files with 19 additions and 37 deletions

View file

@ -2434,23 +2434,15 @@ udmf
} }
arg1 arg1
{ {
title = "Set heights?"; title = "Affected planes";
type = 12; type = 11;
enum enum = "floorceiling";
{
1 = "Floor";
2 = "Ceiling";
}
} }
arg2 arg2
{ {
title = "Set flats?"; title = "Set flats?";
type = 12; type = 11;
enum enum = "noyes";
{
1 = "Floor";
2 = "Ceiling";
}
} }
} }

View file

@ -273,27 +273,19 @@ INT32 EV_DoCeiling(mtag_t tag, line_t *line, ceiling_e type)
case instantMoveCeilingByFrontSector: case instantMoveCeilingByFrontSector:
ceiling->speed = INT32_MAX/2; ceiling->speed = INT32_MAX/2;
if (lines->args[1] & 2) if (line->frontsector->ceilingheight >= sec->ceilingheight) // Move up
{
if (line->frontsector->ceilingheight >= sec->ceilingheight) // Move up
{
ceiling->direction = 1;
ceiling->topheight = line->frontsector->ceilingheight;
}
else // Move down
{
ceiling->direction = -1;
ceiling->bottomheight = line->frontsector->ceilingheight;
}
}
else
{ {
ceiling->direction = 1; ceiling->direction = 1;
ceiling->topheight = sec->ceilingheight; ceiling->topheight = line->frontsector->ceilingheight;
}
else // Move down
{
ceiling->direction = -1;
ceiling->bottomheight = line->frontsector->ceilingheight;
} }
// If flag is set, change ceiling texture after moving // If flag is set, change ceiling texture after moving
ceiling->texture = (line->args[2] & 2) ? line->frontsector->ceilingpic : -1; ceiling->texture = line->args[2] ? line->frontsector->ceilingpic : -1;
break; break;
case moveCeilingByDistance: case moveCeilingByDistance:

View file

@ -1796,11 +1796,9 @@ void EV_DoFloor(mtag_t tag, line_t *line, floor_e floortype)
dofloor->floordestheight = P_FindLowestFloorSurrounding(sec); dofloor->floordestheight = P_FindLowestFloorSurrounding(sec);
break; break;
// Linedef executor command, linetype 101.
// Front sector floor = destination height.
case instantMoveFloorByFrontSector: case instantMoveFloorByFrontSector:
dofloor->speed = INT32_MAX/2; // as above, "instant" is one tic dofloor->speed = INT32_MAX/2; // as above, "instant" is one tic
dofloor->floordestheight = (line->args[1] & 1) ? line->frontsector->floorheight : sec->floorheight; dofloor->floordestheight = line->frontsector->floorheight;
if (dofloor->floordestheight >= sec->floorheight) if (dofloor->floordestheight >= sec->floorheight)
dofloor->direction = 1; // up dofloor->direction = 1; // up
@ -1808,7 +1806,7 @@ void EV_DoFloor(mtag_t tag, line_t *line, floor_e floortype)
dofloor->direction = -1; // down dofloor->direction = -1; // down
// If flag is set, change floor texture after moving // If flag is set, change floor texture after moving
dofloor->texture = (line->args[2] & 1) ? line->frontsector->floorpic : -1; dofloor->texture = line->args[2] ? line->frontsector->floorpic : -1;
break; break;
case moveFloorByFrontSector: case moveFloorByFrontSector:

View file

@ -3548,8 +3548,8 @@ static void P_ConvertBinaryMap(void)
case 400: //Set tagged sector's floor height/texture case 400: //Set tagged sector's floor height/texture
case 401: //Set tagged sector's ceiling height/texture case 401: //Set tagged sector's ceiling height/texture
lines[i].args[0] = tag; lines[i].args[0] = tag;
lines[i].args[1] = lines[i].special - 399; lines[i].args[1] = lines[i].special - 400;
lines[i].args[2] = (lines[i].flags & ML_NOCLIMB) ? 0 : lines[i].special - 399; lines[i].args[2] = !!(lines[i].flags & ML_NOCLIMB);
lines[i].special = 400; lines[i].special = 400;
break; break;
case 403: //Move tagged sector's floor case 403: //Move tagged sector's floor

View file

@ -2234,9 +2234,9 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
switch (line->special) switch (line->special)
{ {
case 400: // Set tagged sector's heights/flats case 400: // Set tagged sector's heights/flats
if (line->args[1] & 1 || line->args[2] & 1) if (line->args[1] != 1)
EV_DoFloor(line->args[0], line, instantMoveFloorByFrontSector); EV_DoFloor(line->args[0], line, instantMoveFloorByFrontSector);
if (line->args[1] & 2 || line->args[2] & 2) if (line->args[1] != 0)
EV_DoCeiling(line->args[0], line, instantMoveCeilingByFrontSector); EV_DoCeiling(line->args[0], line, instantMoveCeilingByFrontSector);
break; break;