Expand 3D floor checks to encompass SRB2's multiple actions

This commit is contained in:
spherallic 2023-09-14 22:17:57 +02:00
parent 181df8bb15
commit 7964875710
9 changed files with 12 additions and 12 deletions

View file

@ -660,7 +660,7 @@ namespace CodeImp.DoomBuilder.Rendering
//find lines with 3d floor action and collect sector tags
foreach(Linedef l in General.Map.Map.Linedefs)
{
if(l.Action == 160)
if(l.Action >= 100 && l.Action < 300)
{
int sectortag = (General.Map.UDMF || (l.Args[1] & 8) != 0) ? l.Args[0] : l.Args[0] + (l.Args[4] << 8);
if(sectortag != 0 && !tags.Contains(sectortag)) tags.Add(sectortag);

View file

@ -776,7 +776,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
if (ld.Front == null || ld.Front.Sector == null || ld.Front.Sector.IsDisposed || (General.Map.UDMF && ld.Front.Sector.Fields.GetValue("user_managed_3d_floor", false) == false))
continue;
if (ld.Action == 160 && ld.Args[0] != 0)
if ((ld.Action >= 100 && ld.Action < 300) && ld.Args[0] != 0)
{
if (!tags.ContainsKey(ld.Args[0]))
tags.Add(ld.Args[0], new List<Sector>() { ld.Front.Sector });

View file

@ -542,7 +542,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
//Determine whether or not the sector is actually a control sector for a 3D floor
foreach (Sidedef sd in s.Sidedefs)
{
if (sd.Line.Action == 160)
if (sd.Line.Action >= 100 && sd.Line.Action < 300)
return true;
}
return false;

View file

@ -168,7 +168,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
// tagged sector(s). They will be used for highlighting in slope mode
foreach (Sidedef sd in s.Sidedefs)
{
if (sd.Line.Action == 160)
if (sd.Line.Action >= 100 && sd.Line.Action < 300)
{
foreach (Sector ts in BuilderPlug.GetSectorsByTag(sd.Line.Args[0]))
{

View file

@ -132,7 +132,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
foreach (Sidedef sd in sector.Sidedefs)
{
if (sd.Line.Action == 160)
if (sd.Line.Action >= 100 && sd.Line.Action < 300)
{
bordertexture = sd.MiddleTexture;
udmftag = sd.Line.Args[0];
@ -197,7 +197,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
if(ldprops != null)
ldprops.Apply(new List<Linedef>() { line }, false);
line.Action = 160;
line.Action = 100;
line.Args[0] = tag;
line.Args[1] = type;
line.Args[2] = flags;
@ -224,7 +224,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
sd.SetTextureMid(bordertexture);
if (sd.Line.Action == 160)
if (sd.Line.Action >= 100 && sd.Line.Action < 300)
{
sd.Line.Args[1] = type;
sd.Line.Args[2] = flags;
@ -315,7 +315,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
foreach (Sidedef sd in sector.Sidedefs)
{
if (sd.Line.Action == 160 && BuilderPlug.GetSectorsByTag(sd.Line.Args[0]).Count == 0)
if ((sd.Line.Action >= 100 && sd.Line.Action < 300) && BuilderPlug.GetSectorsByTag(sd.Line.Args[0]).Count == 0)
{
sd.Line.Action = 0;

View file

@ -443,7 +443,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// sectors that need updating
foreach (Linedef ld in General.Map.Map.Linedefs)
{
if (ld.Action != 160) // Action 160 defines a 3D floor
if (ld.Action < 100 && ld.Action >= 300) // SRB2 FOF types
continue;
foreach (Sector s in draggedsectors)

View file

@ -1648,7 +1648,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
foreach (Linedef ld in General.Map.Map.Linedefs)
{
if (ld.Action != 160) // Action 160 defines a 3D floor
if (ld.Action < 100 || ld.Action >= 300) // SRB2 FOF types
continue;
if (ld.Args[0] == 0) // First argument of the action is the sector tag. 0 is not a valid value

View file

@ -82,7 +82,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
foreach (Linedef ld in General.Map.Map.Linedefs)
{
if (ld.Action == 160)
if (ld.Action >= 100 && ld.Action < 300)
{
if ((ld.Args[1] & 4) == 4) // Type render inside
{

View file

@ -377,7 +377,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.IO
{
foreach (Sidedef sd in s.Sidedefs)
{
if (sd.Line.Action == 160)
if (sd.Line.Action >= 100 && sd.Line.Action < 300)
{
addvs = false;
break;