DECORATE support: added a warning when a sprite assigned using "$sprite" special comment does not exist.

This commit is contained in:
MaxED 2016-01-17 23:50:07 +00:00
parent c11d5302c1
commit 0e718c9780

View file

@ -589,10 +589,13 @@ namespace CodeImp.DoomBuilder.ZDoom
// Sprite forced?
if(HasPropertyWithValue("$sprite"))
{
return GetPropertyValueString("$sprite", 0);
string sprite = GetPropertyValueString("$sprite", 0); //mxd
if(General.Map.Data.GetSpriteExists(sprite)) return sprite; //mxd. Added availability check
//mxd. Bitch and moan
General.ErrorLogger.Add(ErrorType.Warning, "DECORATE warning in " + classname + ":" + doomednum + ". The sprite \"" + sprite + "\" assigned by the \"$sprite\" property does not exist.");
}
else
{
// Try the idle state
if(HasState("idle"))
{
@ -654,7 +657,6 @@ namespace CodeImp.DoomBuilder.ZDoom
return result + postfix;
}
}
}
// No sprite found
return string.Empty;