summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spritecache.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/spritecache.c b/spritecache.c
index ada918bb3..0235bf186 100644
--- a/spritecache.c
+++ b/spritecache.c
@@ -154,6 +154,14 @@ static void ReadSprite(SpriteID id, void *buffer)
byte type;
byte* dest;
+ if (_sprite_file_pos[id] == 0) {
+ error(
+ "Tried to load non-existing sprite #%d.\n"
+ "Probable cause: Wrong/missing NewGRFs",
+ id
+ );
+ }
+
FioSeekToFile(_sprite_file_pos[id]);
type = FioReadByte();