summaryrefslogtreecommitdiff
path: root/src/spritecache.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2008-06-05 20:54:52 +0000
committerglx <glx@openttd.org>2008-06-05 20:54:52 +0000
commitb60a1326bf3ea9b9e0235cf18cdcd964c758a8bf (patch)
tree62bef57de81c1ddcc691d5de5e8db395615bdacc /src/spritecache.cpp
parentbb758700a87b19e47c6ef7aa28280ca05badd62f (diff)
downloadopenttd-b60a1326bf3ea9b9e0235cf18cdcd964c758a8bf.tar.xz
(svn r13390) -Codechange: introduce usererror() for fatal but not openttd related errors. Now all error() will 'crash' openttd after showing the message in win32 releases (MSVC), creating a crash.log and crash.dmp (like the '!' hack used before). On the other hand, usererror() will just close the game. So use error() only when it can be helpful to debugging, else use usererror().
Diffstat (limited to 'src/spritecache.cpp')
-rw-r--r--src/spritecache.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/spritecache.cpp b/src/spritecache.cpp
index adc0145df..248a6d5ef 100644
--- a/src/spritecache.cpp
+++ b/src/spritecache.cpp
@@ -169,7 +169,7 @@ static void* ReadSprite(SpriteCache *sc, SpriteID id, bool real_sprite)
static byte warning_level = 0;
DEBUG(sprite, warning_level, "Tried to load non sprite #%d as a real sprite. Probable cause: NewGRF interference", id);
warning_level = 6;
- if (id == SPR_IMG_QUERY) error("Uhm, would you be so kind not to load a NewGRF that makes the 'query' sprite a non- sprite?");
+ if (id == SPR_IMG_QUERY) usererror("Uhm, would you be so kind not to load a NewGRF that makes the 'query' sprite a non- sprite?");
return (void*)GetSprite(SPR_IMG_QUERY);
}
@@ -246,7 +246,7 @@ bool LoadNextSprite(int load_index, byte file_slot, uint file_sprite_id)
if (!ReadSpriteHeaderSkipData()) return false;
if (load_index >= MAX_SPRITES) {
- error("Tried to load too many sprites (#%d; max %d)", load_index, MAX_SPRITES);
+ usererror("Tried to load too many sprites (#%d; max %d)", load_index, MAX_SPRITES);
}
sc = AllocateSpriteCache(load_index);