Author: cazfi
Date: Mon Aug  8 22:11:32 2016
New Revision: 33516

URL: http://svn.gna.org/viewcvs/freeciv?rev=33516&view=rev
Log:
Made extra to get drawn if drawing option matching any of its causes is enabled,
or there's no drawing option associated with it at all.

See bug #24238

Modified:
    trunk/client/tilespec.c

Modified: trunk/client/tilespec.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/tilespec.c?rev=33516&r1=33515&r2=33516&view=diff
==============================================================================
--- trunk/client/tilespec.c     (original)
+++ trunk/client/tilespec.c     Mon Aug  8 22:11:32 2016
@@ -5171,44 +5171,53 @@
 ****************************************************************************/
 static bool is_extra_drawing_enabled(struct extra_type *pextra)
 {
+  bool no_disable = TRUE; /* Draw if matches no cause */
+
   if (is_extra_caused_by(pextra, EC_IRRIGATION)) {
-    if (!gui_options.draw_irrigation) {
-      return FALSE;
-    }
+    if (gui_options.draw_irrigation) {
+      return TRUE;
+    }
+    no_disable = FALSE;
   }
   if (is_extra_caused_by(pextra, EC_POLLUTION)
       || is_extra_caused_by(pextra, EC_FALLOUT)) {
-    if (!gui_options.draw_pollution) {
-      return FALSE;
-    }
+    if (gui_options.draw_pollution) {
+      return TRUE;
+    }
+    no_disable = FALSE;
   }
   if (is_extra_caused_by(pextra, EC_MINE)) {
-    if (!gui_options.draw_mines) {
-      return FALSE;
-    }
+    if (gui_options.draw_mines) {
+      return TRUE;
+    }
+    no_disable = FALSE;
   }
   if (is_extra_caused_by(pextra, EC_RESOURCE)) {
-    if (!gui_options.draw_specials) {
-      return FALSE;
-    }
+    if (gui_options.draw_specials) {
+      return TRUE;
+    }
+    no_disable = FALSE;
   }
   if (is_extra_caused_by(pextra, EC_HUT)) {
-    if (!gui_options.draw_huts) {
-      return FALSE;
-    }
+    if (gui_options.draw_huts) {
+      return TRUE;
+    }
+    no_disable = FALSE;
   }
   if (is_extra_caused_by(pextra, EC_BASE)) {
-    if (!gui_options.draw_fortress_airbase) {
-      return FALSE;
-    }
+    if (gui_options.draw_fortress_airbase) {
+      return TRUE;
+    }
+    no_disable = FALSE;
   }
   if (is_extra_caused_by(pextra, EC_ROAD)) {
-    if (!gui_options.draw_roads_rails) {
-      return FALSE;
-    }
-  }
-
-  return TRUE;
+    if (gui_options.draw_roads_rails) {
+      return TRUE;
+    }
+    no_disable = FALSE;
+  }
+
+  return no_disable;
 }
 
 /****************************************************************************


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to