CVars:
Code: Select all
user bool win_window = false;
user bool win_win2floor = false;
user bool win_win2ceiling = false;
user bool win_blocking = true;
ZScript:
Code: Select all
class windows_EventHandler : EventHandler
{
override
void WorldLoaded(WorldEvent e)
{
int BLOCKING = 1; // bit 0x0001
int TWOSIDED = 2; // bit 0x0004
int DONTPEGTOP = 4; // bit 0x0008
int DONTPEGBOTTOM = 8; // bit 0x0010
for(int i = 0; i < Level.Sectors.Size(); i++)
{
for (int ii = 0; ii < Level.Sectors[i].lines.Size(); ii++)
{
int f = Level.Sectors[i].lines[ii].flags;
int peg_top = f & (BLOCKING + TWOSIDED + DONTPEGTOP);
int peg_bottom = f & (BLOCKING + TWOSIDED + DONTPEGBOTTOM);
int blocking = f & (BLOCKING + TWOSIDED);
if (CVar.FindCVar("win_window").GetBool() && peg_top && peg_bottom)
{
Level.Sectors[i].lines[ii].flags = f ^ BLOCKING;
}
if (CVar.FindCVar("win_win2floor").GetBool() && peg_top && !peg_bottom)
{
Level.Sectors[i].lines[ii].flags = f ^ BLOCKING;
}
if (CVar.FindCVar("win_win2ceiling").GetBool() && !peg_top && peg_bottom)
{
Level.Sectors[i].lines[ii].flags = f ^ BLOCKING;
}
if (CVar.FindCVar("win_blocking").GetBool() && blocking)
{
Level.Sectors[i].lines[ii].flags = f ^ BLOCKING;
}
}
}
}
}
Update 11/14/21
Spoiler: