mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-04-22 01:10:57 +00:00
Added availability check and fixed preview image lookup for sprites of custom Things.
This commit is contained in:
parent
e501646989
commit
cd54edc410
2 changed files with 15 additions and 2 deletions
|
@ -440,6 +440,12 @@ namespace CodeImp.DoomBuilder.Config
|
|||
if (this.radius < 4f) this.radius = 8f;
|
||||
if (this.hangs && this.absolutez) this.hangs = false; //mxd
|
||||
|
||||
// Make long name for sprite lookup
|
||||
if (this.sprite.Length <= 8)
|
||||
this.spritelongname = Lump.MakeLongName(this.sprite);
|
||||
else
|
||||
this.spritelongname = long.MaxValue;
|
||||
|
||||
// We have no destructor
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
|
|
@ -150,8 +150,15 @@ namespace CodeImp.DoomBuilder.SRB2
|
|||
if (String.IsNullOrEmpty(line) || line.StartsWith("\n")) break;
|
||||
if (line.StartsWith("#$Sprite "))
|
||||
{
|
||||
sprite = line.Substring(9);
|
||||
continue;
|
||||
string spritename = line.Substring(9);
|
||||
if (((spritename.Length > DataManager.INTERNAL_PREFIX.Length) &&
|
||||
spritename.ToLowerInvariant().StartsWith(DataManager.INTERNAL_PREFIX)) ||
|
||||
General.Map.Data.GetSpriteExists(spritename))
|
||||
{
|
||||
sprite = spritename;
|
||||
continue;
|
||||
}
|
||||
ReportError("The sprite \"" + spritename + "\" assigned by the \"$sprite\" property does not exist");
|
||||
}
|
||||
if (line.StartsWith("#")) continue;
|
||||
line = RemoveComments(line);
|
||||
|
|
Loading…
Reference in a new issue