summaryrefslogtreecommitdiff
path: root/src/spritecache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/spritecache.cpp')
-rw-r--r--src/spritecache.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/spritecache.cpp b/src/spritecache.cpp
index 4de7e076b..a354c65ff 100644
--- a/src/spritecache.cpp
+++ b/src/spritecache.cpp
@@ -271,7 +271,10 @@ static void* ReadSprite(SpriteCache *sc, SpriteID id, SpriteType sprite_type)
sc->type = sprite_type;
- if (!sprite_loader.LoadSprite(&sprite, file_slot, file_pos, sprite_type)) return NULL;
+ if (!sprite_loader.LoadSprite(&sprite, file_slot, file_pos, sprite_type)) {
+ if (id == SPR_IMG_QUERY) usererror("Okay... something went horribly wrong. I couldn't load the fallback sprite. What should I do?");
+ return (void*)GetRawSprite(SPR_IMG_QUERY, ST_NORMAL);
+ }
sc->ptr = BlitterFactoryBase::GetCurrentBlitter()->Encode(&sprite, &AllocSprite);
free(sprite.data);