1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-25 23:49:09 +00:00

(svn r7242) -Fix: Don't load 1-byte pseudo sprites, as used in some NewGRF sets. If the sprite is ever drawn this will result in a "missing sprite" error instead of undefined misbehaviour leading to segmentation faults...

This commit is contained in:
2006-11-23 21:19:43 +00:00
parent 59723b113e
commit 1ce4eda576

View File

@@ -45,7 +45,9 @@ static bool ReadSpriteHeaderSkipData(void)
type = FioReadByte(); type = FioReadByte();
if (type == 0xFF) { if (type == 0xFF) {
FioSkipBytes(num); FioSkipBytes(num);
return true; /* Some NewGRF files have "empty" pseudo-sprites which are 1
* byte long. Catch these so the sprites won't be displayed. */
return num != 1;
} }
FioSkipBytes(7); FioSkipBytes(7);