fixed bug causing crash when trying to draw undefined optional graphics
[rocksndiamonds.git] / src / tools.c
index 76b40a291272a7c899ca1fba7c003f69ccfcf72b..6d3a0aeb00f5866603f28f4a720b0b05bd17d3b5 100644 (file)
@@ -1574,6 +1574,10 @@ void getSizedGraphicSourceExt(int graphic, int frame, int tilesize,
 {
   struct GraphicInfo *g = &graphic_info[graphic];
 
+  // if no graphics defined at all, use fallback graphics
+  if (g->bitmaps == NULL)
+    *g = graphic_info[IMG_CHAR_EXCLAM];
+
   // if no in-game graphics defined, always use standard graphic size
   if (g->bitmaps[IMG_BITMAP_GAME] == NULL)
     tilesize = TILESIZE;