mirror of https://github.com/OpenTTD/OpenTTD
(svn r25821) -Fix-ish: Sprite 0 was considered available, even if no baseset was loaded.
parent
640d39c001
commit
1e0dd39075
|
@ -118,9 +118,10 @@ bool SkipSpriteData(byte type, uint16 num)
|
||||||
/* Check if the given Sprite ID exists */
|
/* Check if the given Sprite ID exists */
|
||||||
bool SpriteExists(SpriteID id)
|
bool SpriteExists(SpriteID id)
|
||||||
{
|
{
|
||||||
|
if (id >= _spritecache_items) return false;
|
||||||
|
|
||||||
/* Special case for Sprite ID zero -- its position is also 0... */
|
/* Special case for Sprite ID zero -- its position is also 0... */
|
||||||
if (id == 0) return true;
|
if (id == 0) return true;
|
||||||
if (id >= _spritecache_items) return false;
|
|
||||||
return !(GetSpriteCache(id)->file_pos == 0 && GetSpriteCache(id)->file_slot == 0);
|
return !(GetSpriteCache(id)->file_pos == 0 && GetSpriteCache(id)->file_slot == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue