Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2005:
[Freeciv-Dev] (PR#14820) wrong city graphics drawn
Home

[Freeciv-Dev] (PR#14820) wrong city graphics drawn

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#14820) wrong city graphics drawn
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 10 Dec 2005 14:01:29 -0800
Reply-to: bugs@xxxxxxxxxxx

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

<freim> jdorje: in trunk cities with size 1 doesn't use the smallest 
city size image?
<freim> jdorje: it used the next one
<freim> jdorje: but only for some styles, like the medieval

<freim> jdorje: the smallest city size in any city style is not used in 
current trunk. I can't see anything wrong in the spec-files
<freim> jdorje: did your city wall change mess up something?

I believe this patch should fix it.

-jason

Index: client/tilespec.c
===================================================================
--- client/tilespec.c   (revision 11332)
+++ client/tilespec.c   (working copy)
@@ -1875,13 +1875,15 @@
     return NULL;
   }
 
-  for (t = 0; t < num_thresholds - 1; t++) {
+  /* We find the sprite with the largest threshold value that's no bigger
+   * than this city size. */
+  for (t = 0; t < num_thresholds; t++) {
     if (pcity->size < city_sprite->styles[style].thresholds[t].city_size) {
       break;
     }
   }
 
-  return city_sprite->styles[style].thresholds[t].sprite;
+  return city_sprite->styles[style].thresholds[MAX(t - 1, 0)].sprite;
 }
 
 /****************************************************************************

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#14820) wrong city graphics drawn, Jason Short <=