<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40655 >

If a user tries to ally with another player and is at war
with one of their allies, the server correctly disallows
the alliance, but does not notify the user of the reason.
The accept button just does nothing, leaving the user
wondering if there is a bug of something. The attached
patch makes the server send the reason why the treaty fails.


----------------------------------------------------------------------
敵の敵はうるさいやつだな。
diff --git a/server/diplhand.c b/server/diplhand.c
index 974a8d2..d878b40 100644
--- a/server/diplhand.c
+++ b/server/diplhand.c
@@ -215,6 +215,12 @@ void handle_diplomacy_accept_treaty_req(struct player *pplayer,
           break;
 	case CLAUSE_ALLIANCE:
           diplcheck = pplayer_can_make_treaty(pplayer, pother, DS_ALLIANCE);
+          if (diplcheck == DIPL_ALLIANCE_PROBLEM) {
+            notify_player(pplayer, NULL, E_DIPLOMACY,
+                          _("You cannot form an alliance because you are "
+                            "at war with one of %s's allies."),
+                          player_name(pplayer));
+          }
           if (diplcheck != DIPL_OK) {
             return;
           }
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to