diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index acf99d5d1b..9e2ef889e7 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -2765,6 +2765,54 @@ FUNC(LS_Line_SetBlocking) return true; } +FUNC(LS_Line_SetAutomapFlags) +// Line_SetAutomapFlags (id, setflags, clearflags) +{ + static const int flagtrans[] = + { + ML_SECRET, + ML_DONTDRAW, + ML_MAPPED, + ML_REVEALED, + -1 + }; + + if (arg0 == 0) return false; + + int setflags = 0; + int clearflags = 0; + + for (int i = 0; flagtrans[i] != ML_PORTALCONNECT; i++, arg1 >>= 1, arg2 >>= 1) + { + if (arg1 & 1) setflags |= flagtrans[i]; + if (arg2 & 1) clearflags |= flagtrans[i]; + } + + FLineIdIterator itr(arg0); + int line; + while ((line = itr.Next()) >= 0) + { + level.lines[line].flags = (level.lines[line].flags & ~clearflags) | setflags; + } + + return true; +} + +FUNC(LS_Line_SetAutomapStyle) +// Line_SetAutomapStyle (id, setflags, clearflags) +{ + if (arg1 < AMLS_COUNT && arg1 >= 0) { + FLineIdIterator itr(arg0); + int line; + while ((line = itr.Next()) >= 0) + { + level.lines[line].automapstyle = (AutomapLineStyle) arg1; + } + + return true; + } + return false; +} FUNC(LS_ChangeCamera) @@ -3713,6 +3761,8 @@ static lnSpecFunc LineSpecials[] = /* 278 */ LS_Sector_SetCeilingGlow, /* 279 */ LS_Floor_MoveToValueAndCrush, /* 280 */ LS_Ceiling_MoveToValueAndCrush, + /* 281 */ LS_Line_SetAutomapFlags, + /* 282 */ LS_Line_SetAutomapStyle, };