mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-06-02 09:51:47 +00:00
Added error check for unknown flat names.
@ Some fixes in default texture/flat determination and added nicer functions to check if texture/flat exists.
This commit is contained in:
parent
78b0285edc
commit
f8aea7cbc4
8 changed files with 273 additions and 95 deletions
|
@ -418,9 +418,12 @@ namespace CodeImp.DoomBuilder.Config
|
|||
{
|
||||
if(!sd.MiddleTexture.StartsWith("-"))
|
||||
{
|
||||
foundone = true;
|
||||
defaulttexture = sd.MiddleTexture;
|
||||
break;
|
||||
if(General.Map.Data.GetTextureExists(defaulttexture))
|
||||
{
|
||||
foundone = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -455,10 +458,18 @@ namespace CodeImp.DoomBuilder.Config
|
|||
foundone = false;
|
||||
if(General.Map.Map.Sectors.Count > 0)
|
||||
{
|
||||
foundone = true;
|
||||
defaultfloortexture = General.GetByIndex(General.Map.Map.Sectors, 0).FloorTexture;
|
||||
// Find one that is known
|
||||
foreach(Sector s in General.Map.Map.Sectors)
|
||||
{
|
||||
defaultfloortexture = s.FloorTexture;
|
||||
if(General.Map.Data.GetFlatExists(defaultfloortexture))
|
||||
{
|
||||
foundone = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Pick the first FLOOR from the list.
|
||||
if(!foundone)
|
||||
{
|
||||
|
@ -480,7 +491,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
defaultfloortexture = General.Map.Data.FlatNames[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Default ceiling missing?
|
||||
if((defaultceiltexture == null) || (defaultceiltexture.Length == 0))
|
||||
{
|
||||
|
@ -488,10 +499,18 @@ namespace CodeImp.DoomBuilder.Config
|
|||
foundone = false;
|
||||
if(General.Map.Map.Sectors.Count > 0)
|
||||
{
|
||||
foundone = true;
|
||||
defaultceiltexture = General.GetByIndex(General.Map.Map.Sectors, 0).CeilTexture;
|
||||
// Find one that is known
|
||||
foreach(Sector s in General.Map.Map.Sectors)
|
||||
{
|
||||
defaultceiltexture = s.CeilTexture;
|
||||
if(General.Map.Data.GetFlatExists(defaultceiltexture))
|
||||
{
|
||||
foundone = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Pick the first CEIL from the list.
|
||||
if(!foundone)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue