Author: sveinung
Date: Mon Aug 24 14:19:10 2015
New Revision: 29665

URL: http://svn.gna.org/viewcvs/freeciv?rev=29665&view=rev
Log:
Explain if unclaimed tgt tile blocks action

See patch #6274

Modified:
    trunk/server/unithand.c

Modified: trunk/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unithand.c?rev=29665&r1=29664&r2=29665&view=diff
==============================================================================
--- trunk/server/unithand.c     (original)
+++ trunk/server/unithand.c     Mon Aug 24 14:19:10 2015
@@ -96,6 +96,8 @@
   ANEK_IS_NOT_CITY_CENTER,
   /* Explanation: can't be done to claimed target tiles. */
   ANEK_TGT_IS_CLAIMED,
+  /* Explanation: can't be done to unclaimed target tiles. */
+  ANEK_TGT_IS_UNCLAIMED,
   /* Explanation: the action is disabled in this scenario. */
   ANEK_SCENARIO_DISABLED,
   /* Explanation not detected. */
@@ -811,6 +813,12 @@
                                              CITYT_CLAIMED,
                                              TRUE)) {
     expl->kind = ANEK_TGT_IS_CLAIMED;
+  } else if ((target_tile && tile_owner(target_tile) == NULL)
+             && !utype_may_act_tgt_city_tile(unit_type(punit),
+                                             action_id,
+                                             CITYT_CLAIMED,
+                                             FALSE)) {
+    expl->kind = ANEK_TGT_IS_UNCLAIMED;
   } else if ((game.scenario.prevent_new_cities
               && utype_can_do_action(unit_type(punit), ACTION_FOUND_CITY))
              && (action_id == ACTION_FOUND_CITY
@@ -893,6 +901,10 @@
   case ANEK_TGT_IS_CLAIMED:
     notify_player(pplayer, unit_tile(punit), E_BAD_COMMAND, ftc_server,
                   _("This unit cannot act against claimed tiles."));
+    break;
+  case ANEK_TGT_IS_UNCLAIMED:
+    notify_player(pplayer, unit_tile(punit), E_BAD_COMMAND, ftc_server,
+                  _("This unit cannot act against unclaimed tiles."));
     break;
   case ANEK_SCENARIO_DISABLED:
     notify_player(pplayer, unit_tile(punit), E_BAD_COMMAND, ftc_server,
@@ -1181,6 +1193,13 @@
     notify_player(pplayer, unit_tile(actor),
                   event, ftc_server,
                   _("Your %s can't do %s to claimed tiles."),
+                  unit_name_translation(actor),
+                  gen_action_translated_name(stopped_action));
+    break;
+  case ANEK_TGT_IS_UNCLAIMED:
+    notify_player(pplayer, unit_tile(actor),
+                  event, ftc_server,
+                  _("Your %s can't do %s to unclaimed tiles."),
                   unit_name_translation(actor),
                   gen_action_translated_name(stopped_action));
     break;


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

Reply via email to