mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-24 13:21:20 +00:00
Now that set flats linedef exists, simplify set heights linedef
This commit is contained in:
parent
099cea0a19
commit
2da5b54e73
5 changed files with 19 additions and 37 deletions
|
@ -2434,23 +2434,15 @@ udmf
|
|||
}
|
||||
arg1
|
||||
{
|
||||
title = "Set heights?";
|
||||
type = 12;
|
||||
enum
|
||||
{
|
||||
1 = "Floor";
|
||||
2 = "Ceiling";
|
||||
}
|
||||
title = "Affected planes";
|
||||
type = 11;
|
||||
enum = "floorceiling";
|
||||
}
|
||||
arg2
|
||||
{
|
||||
title = "Set flats?";
|
||||
type = 12;
|
||||
enum
|
||||
{
|
||||
1 = "Floor";
|
||||
2 = "Ceiling";
|
||||
}
|
||||
type = 11;
|
||||
enum = "noyes";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -273,27 +273,19 @@ INT32 EV_DoCeiling(mtag_t tag, line_t *line, ceiling_e type)
|
|||
case instantMoveCeilingByFrontSector:
|
||||
ceiling->speed = INT32_MAX/2;
|
||||
|
||||
if (lines->args[1] & 2)
|
||||
{
|
||||
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
|
||||
if (line->frontsector->ceilingheight >= sec->ceilingheight) // Move up
|
||||
{
|
||||
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
|
||||
ceiling->texture = (line->args[2] & 2) ? line->frontsector->ceilingpic : -1;
|
||||
ceiling->texture = line->args[2] ? line->frontsector->ceilingpic : -1;
|
||||
break;
|
||||
|
||||
case moveCeilingByDistance:
|
||||
|
|
|
@ -1796,11 +1796,9 @@ void EV_DoFloor(mtag_t tag, line_t *line, floor_e floortype)
|
|||
dofloor->floordestheight = P_FindLowestFloorSurrounding(sec);
|
||||
break;
|
||||
|
||||
// Linedef executor command, linetype 101.
|
||||
// Front sector floor = destination height.
|
||||
case instantMoveFloorByFrontSector:
|
||||
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)
|
||||
dofloor->direction = 1; // up
|
||||
|
@ -1808,7 +1806,7 @@ void EV_DoFloor(mtag_t tag, line_t *line, floor_e floortype)
|
|||
dofloor->direction = -1; // down
|
||||
|
||||
// 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;
|
||||
|
||||
case moveFloorByFrontSector:
|
||||
|
|
|
@ -3548,8 +3548,8 @@ static void P_ConvertBinaryMap(void)
|
|||
case 400: //Set tagged sector's floor height/texture
|
||||
case 401: //Set tagged sector's ceiling height/texture
|
||||
lines[i].args[0] = tag;
|
||||
lines[i].args[1] = lines[i].special - 399;
|
||||
lines[i].args[2] = (lines[i].flags & ML_NOCLIMB) ? 0 : lines[i].special - 399;
|
||||
lines[i].args[1] = lines[i].special - 400;
|
||||
lines[i].args[2] = !!(lines[i].flags & ML_NOCLIMB);
|
||||
lines[i].special = 400;
|
||||
break;
|
||||
case 403: //Move tagged sector's floor
|
||||
|
|
|
@ -2234,9 +2234,9 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
|||
switch (line->special)
|
||||
{
|
||||
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);
|
||||
if (line->args[1] & 2 || line->args[2] & 2)
|
||||
if (line->args[1] != 0)
|
||||
EV_DoCeiling(line->args[0], line, instantMoveCeilingByFrontSector);
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in a new issue