Author: sveinung
Date: Tue Mar  8 15:08:49 2016
New Revision: 32197

URL: http://svn.gna.org/viewcvs/freeciv?rev=32197&view=rev
Log:
metaknowledge: a non city can't have a building.

It is known that a building is missing when no city to contain it exists.

See bug #24503

Modified:
    trunk/common/metaknowledge.c

Modified: trunk/common/metaknowledge.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/metaknowledge.c?rev=32197&r1=32196&r2=32197&view=diff
==============================================================================
--- trunk/common/metaknowledge.c        (original)
+++ trunk/common/metaknowledge.c        Tue Mar  8 15:08:49 2016
@@ -370,6 +370,11 @@
     /* The only legal range when this was written was local. */
     fc_assert(req->range == REQ_RANGE_LOCAL);
 
+    if (!target_city) {
+      /* Can't be. No city to contain it. */
+      return TRUE;
+    }
+
     /* Local BuildingGenus could be about city production. */
     return can_player_see_city_internals(pow_player, target_city);
   }
@@ -393,6 +398,11 @@
       return FALSE;
     case REQ_RANGE_CITY:
     case REQ_RANGE_LOCAL:
+      if (!target_city) {
+        /* Can't be. No city to contain it. */
+        return TRUE;
+      }
+
       if (can_player_see_city_internals(pow_player, target_city)) {
         /* Anyone that can see city internals (like the owner) known all
          * its improvements. */


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

Reply via email to