From 41957a85676acb8e320c1c5390d899ea50ee548b Mon Sep 17 00:00:00 2001
From: Sveinung Kvilhaugsvik <sveinung84@users.sourceforge.net>
Date: Mon, 31 May 2021 06:55:46 +0200
Subject: [PATCH 02/10] Action not enabled explain non allied unit at tgt.

Add an action not enabled explanation kind for a non allied unit being at
the target tile. Not in use yet.

See osdn #42433
---
 common/explanation.h |  2 ++
 server/unithand.c    | 14 ++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/common/explanation.h b/common/explanation.h
index 565e5f6031..5ed0f30988 100644
--- a/common/explanation.h
+++ b/common/explanation.h
@@ -50,6 +50,8 @@ enum ane_kind {
   ANEK_DOMESTIC,
   /* Explanation: can't be done to foreign targets. */
   ANEK_FOREIGN,
+  /* Explanation: can't be done with non allied units at target tile. */
+  ANEK_TGT_NON_ALLIED_UNITS_ON_TILE,
   /* Explanation: this nation can't act. */
   ANEK_NATION_ACT,
   /* Explanation: this nation can't be targeted. */
diff --git a/server/unithand.c b/server/unithand.c
index 101b55e757..efb331b0e1 100644
--- a/server/unithand.c
+++ b/server/unithand.c
@@ -1836,6 +1836,12 @@ static void explain_why_no_action_enabled(struct unit *punit,
     notify_player(pplayer, unit_tile(punit), E_BAD_COMMAND, ftc_server,
                   _("This unit cannot act against foreign targets."));
     break;
+  case ANEK_TGT_NON_ALLIED_UNITS_ON_TILE:
+    notify_player(pplayer, unit_tile(punit), E_BAD_COMMAND, ftc_server,
+                  /* TRANS: Riflemen */
+                  _("%s cannot act against tiles with non allied units."),
+                  unit_name_translation(punit));
+    break;
   case ANEK_NATION_ACT:
      notify_player(pplayer, unit_tile(punit), E_BAD_COMMAND, ftc_server,
                    /* TRANS: Swedish ... Riflemen */
@@ -2474,6 +2480,14 @@ void illegal_action_msg(struct player *pplayer,
                   action_target_kind_translated_name(
                     action_id_get_target_kind(stopped_action)));
     break;
+  case ANEK_TGT_NON_ALLIED_UNITS_ON_TILE:
+    notify_player(pplayer, unit_tile(actor),
+                  event, ftc_server,
+                  /* TRANS: Paratroopers ... Drop Paratrooper */
+                  _("Your %s can't do %s to tiles with non allied units."),
+                  unit_name_translation(actor),
+                  action_id_name_translation(stopped_action));
+    break;
   case ANEK_NATION_ACT:
     notify_player(pplayer, unit_tile(actor),
                   event, ftc_server,
-- 
2.30.2