Author: cazfi
Date: Wed Feb  4 04:37:25 2015
New Revision: 27964

URL: http://svn.gna.org/viewcvs/freeciv?rev=27964&view=rev
Log:
Check that relevant "_Possible" effect can ever be enabled in the ruleset 
before claiming
in the help that Settler can do some activity.

See patch #5774

Modified:
    branches/S2_5/client/helpdata.c

Modified: branches/S2_5/client/helpdata.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/helpdata.c?rev=27964&r1=27963&r2=27964&view=diff
==============================================================================
--- branches/S2_5/client/helpdata.c     (original)
+++ branches/S2_5/client/helpdata.c     Wed Feb  4 04:37:25 2015
@@ -2593,23 +2593,35 @@
 
     /* Roads, rail, mines, irrigation. */
     CATLSTR(buf, bufsz, _("* Can build roads and railroads.\n"));
-    CATLSTR(buf, bufsz, _("* Can build mines on tiles.\n"));
-    CATLSTR(buf, bufsz, _("* Can build irrigation on tiles.\n"));
-
-    /* Farmland. */
-    switch (techs_with_flag_string(buf2, sizeof(buf2), pplayer, TF_FARMLAND)) {
-    case 0:
-      /* Can never build farmland */
-      break;
-    case 1:
-      cat_snprintf(buf, bufsz,
-                  _("* Can build farmland (if %s is known).\n"), buf2);
-      break;
-    default:
-      cat_snprintf(buf, bufsz,
-                  _("* Can build farmland (if any of the following are"
-                    " known: %s).\n"), buf2);
-      break;
+
+    /* TODO: Check also that specific unit fulfills the requirements of the 
effects */
+    if (effect_cumulative_max(EFT_MINING_POSSIBLE) > 0) {
+      CATLSTR(buf, bufsz, _("* Can build mines on tiles.\n"));
+    }
+    if (effect_cumulative_max(EFT_MINING_TF_POSSIBLE) > 0) {
+      CATLSTR(buf, bufsz, _("* Can mine terrain to another.\n"));
+    }
+
+    if (effect_cumulative_max(EFT_IRRIG_POSSIBLE) > 0) {
+      CATLSTR(buf, bufsz, _("* Can build irrigation on tiles.\n"));
+      /* Farmland. */
+      switch (techs_with_flag_string(buf2, sizeof(buf2), pplayer, 
TF_FARMLAND)) {
+      case 0:
+        /* Can never build farmland */
+        break;
+      case 1:
+        cat_snprintf(buf, bufsz,
+                     _("* Can build farmland (if %s is known).\n"), buf2);
+        break;
+      default:
+        cat_snprintf(buf, bufsz,
+                     _("* Can build farmland (if any of the following are"
+                       " known: %s).\n"), buf2);
+        break;
+      }
+    }
+    if (effect_cumulative_max(EFT_IRRIG_TF_POSSIBLE) > 0) {
+      CATLSTR(buf, bufsz, _("* Can irrigate terrain to another.\n"));
     }
 
     /* Pollution, fallout. */


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

Reply via email to