Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2005:
[Freeciv-Dev] (PR#12351) client crashes if darkness sprite isn't present
Home

[Freeciv-Dev] (PR#12351) client crashes if darkness sprite isn't present

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12351) client crashes if darkness sprite isn't present
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 24 Feb 2005 21:51:05 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12351 >

This patch makes it exit with an error message instead.  For 2.0; it 
probably applies to the dev branch as well.

-jason

? freeciv-2.0.0-beta8.tar.gz
? patch.diff
? win32.diff
? data/civgame-3000.sav.gz
? data/civgame-3500.sav.gz
Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.204.2.15
diff -u -r1.204.2.15 tilespec.c
--- client/tilespec.c   6 Feb 2005 21:53:40 -0000       1.204.2.15
+++ client/tilespec.c   25 Feb 2005 05:50:07 -0000
@@ -1466,6 +1466,10 @@
       const int W = NORMAL_TILE_WIDTH, H = NORMAL_TILE_HEIGHT;
       int offsets[4][2] = {{W / 2, 0}, {0, H / 2}, {W / 2, H / 2}, {0, 0}};
 
+      if (!darkness) {
+       freelog(LOG_FATAL, "Sprite tx.darkness missing.");
+       exit(EXIT_FAILURE);
+      }
       for (i = 0; i < 4; i++) {
        sprites.tx.darkness[i] = crop_sprite(darkness, offsets[i][0],
                                             offsets[i][1], W / 2, H / 2,

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12351) client crashes if darkness sprite isn't present, Jason Short <=