Author: cazfi
Date: Sat Apr 16 10:13:44 2016
New Revision: 32421

URL: http://svn.gna.org/viewcvs/freeciv?rev=32421&view=rev
Log:
Made is_native_tile_to_extra() to check resource/terrain compatibility

See patch #7107

Modified:
    trunk/common/extras.c

Modified: trunk/common/extras.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/extras.c?rev=32421&r1=32420&r2=32421&view=diff
==============================================================================
--- trunk/common/extras.c       (original)
+++ trunk/common/extras.c       Sat Apr 16 10:13:44 2016
@@ -520,6 +520,13 @@
                              const struct tile *ptile)
 {
   struct terrain *pterr = tile_terrain(ptile);
+  struct resource_type *pres = extra_resource_get(pextra);
+
+  if (pres != NULL) {
+    if (!terrain_has_resource(pterr, pres)) {
+      return FALSE;
+    }
+  }
 
   if (is_extra_caused_by(pextra, EC_IRRIGATION)
       && pterr->irrigation_result != pterr) {


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

Reply via email to