fixed setting score info to defaults
[rocksndiamonds.git] / src / tools.c
index c849dd3fe0b25bc49ce71a0ef3b6789ee6000972..c8070fa2365f3349e0e68b3a9785f3c9c218f564 100644 (file)
@@ -512,6 +512,10 @@ static void DrawMaskedBorderExt_Rect(int x, int y, int width, int height,
   Bitmap *src_bitmap = getGlobalBorderBitmapFromStatus(global.border_status);
   Bitmap *dst_bitmap = gfx.masked_border_bitmap_ptr;
 
+  // may happen for "border.draw_masked.*" with undefined "global.border.*"
+  if (src_bitmap == NULL)
+    return;
+
   if (x == -1 && y == -1)
     return;
 
@@ -1507,10 +1511,12 @@ int getGraphicAnimationFrameXY(int graphic, int lx, int ly)
 
     return sync_frame % g->anim_frames;
   }
+  else
+  {
+    int sync_frame = (IN_LEV_FIELD(lx, ly) ? GfxFrame[lx][ly] : -1);
 
-  int sync_frame = (IN_LEV_FIELD(lx, ly) ? GfxFrame[lx][ly] : -1);
-
-  return getGraphicAnimationFrame(graphic, sync_frame);
+    return getGraphicAnimationFrame(graphic, sync_frame);
+  }
 }
 
 void getGraphicSourceBitmap(int graphic, int tilesize, Bitmap **bitmap)