Visual Mode: fixed a problem where pasting a texture to a 3D floor sometimes didn't show the pasted texture immediately

This commit is contained in:
biwa 2020-12-31 11:43:56 +01:00 committed by spherallic
parent b31dec526c
commit 6f7b24291d
2 changed files with 26 additions and 8 deletions

View file

@ -419,12 +419,21 @@ namespace CodeImp.DoomBuilder.BuilderModes
SetTexture(BuilderPlug.Me.CopiedFlat);
// Update
if(mode.VisualSectorExists(level.sector))
// Update. We need to create a visual sector if it doesn't exist yet. This can happen when pasting
// to a 3D floor and its control sector wasn't in view before
BaseVisualSector vs;
if (mode.VisualSectorExists(level.sector))
{
BaseVisualSector vs = (BaseVisualSector)mode.GetVisualSector(level.sector);
vs.UpdateSectorGeometry(false);
vs = (BaseVisualSector)mode.GetVisualSector(level.sector);
}
else
{
vs = mode.CreateBaseVisualSector(level.sector);
}
if (vs != null)
vs.UpdateSectorGeometry(false);
}
}

View file

@ -401,12 +401,21 @@ namespace CodeImp.DoomBuilder.BuilderModes
SetTexture(BuilderPlug.Me.CopiedFlat);
// Update
if(mode.VisualSectorExists(level.sector))
// Update. We need to create a visual sector if it doesn't exist yet. This can happen when pasting
// to a 3D floor and its control sector wasn't in view before
BaseVisualSector vs;
if (mode.VisualSectorExists(level.sector))
{
BaseVisualSector vs = (BaseVisualSector)mode.GetVisualSector(level.sector);
vs.UpdateSectorGeometry(false);
vs = (BaseVisualSector)mode.GetVisualSector(level.sector);
}
else
{
vs = mode.CreateBaseVisualSector(level.sector);
}
if (vs != null)
vs.UpdateSectorGeometry(false);
}
}