Handle locknumber in boundary checks, check for FS_Execute

This commit is contained in:
Teemu Piippo 2015-09-12 14:02:07 +03:00
parent 2f027504b6
commit 67a7f48ca3

View file

@ -2323,21 +2323,50 @@ bool AM_isTriggerBoundary (line_t& line)
bool AM_isLockSpecial (int special, int* args)
{
return special == Door_LockedRaise ||
special == ACS_LockedExecute ||
special == ACS_LockedExecuteDoor ||
(special == Door_Animated && args[3] != 0) ||
(special == Generic_Door && args[4] != 0);
return special == Door_LockedRaise
|| special == ACS_LockedExecute
|| special == ACS_LockedExecuteDoor
|| (special == Door_Animated && args[3] != 0)
|| (special == Generic_Door && args[4] != 0)
|| (special == FS_Execute && args[2] != 0);
}
bool AM_isLockBoundary (line_t &line, int *lockptr = NULL)
{
if (lockptr == NULL)
{
static int sink;
lockptr = &sink;
}
if (line.locknumber)
{
*lockptr = line.locknumber;
return true;
}
int special;
int *args;
bool result = AM_checkSpecialBoundary(line, &AM_isLockSpecial, &special, &args);
if (lockptr && result)
*lockptr = (special==Door_LockedRaise || special==Door_Animated) ? args[3] : args[4];
if (result)
{
switch (special)
{
case FS_Execute:
*lockptr = args[2];
break;
case Door_Animated:
case Door_LockedRaise:
*lockptr = args[3];
break;
default:
*lockptr = args[4];
break;
}
}
return result;
}
@ -2390,17 +2419,6 @@ void AM_drawWalls (bool allmap)
else
AM_drawMline(&l, AMColors.WallColor);
}
else if (lines[i].locknumber > 0 && AMColors.displayLocks)
{ // [Dusk] specials w/ locknumbers
lock = lines[i].locknumber;
color = P_GetMapColorForLock(lock);
AMColor c;
if (color >= 0) c.FromRGB(RPART(color), GPART(color), BPART(color));
else c = AMColors[AMColors.LockedColor];
AM_drawMline (&l, c);
}
else if (AM_isTeleportBoundary(lines[i]) && AMColors.isValid(AMColors.IntraTeleportColor))
{ // intra-level teleporters
AM_drawMline(&l, AMColors.IntraTeleportColor);