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

> [cazf...@gmail.com - Sun Jan 11 14:21:43 2009]:
> 
> 2009/1/10 Madeline Book:
> >
> > 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.
> 
>  Shouldn't either 'pplayer' be 'pother'? Seems like you are claiming
> that player is in war with his/her own ally.

Correct. I made a mistake in the player_name() argument.


-----------------------------------------------------------------------
解離性同一性障害
diff --git a/server/diplhand.c b/server/diplhand.c
index 974a8d2..e8d71ab 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 an ally of %s."),
+                          player_name(pother));
+          }
           if (diplcheck != DIPL_OK) {
             return;
           }
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to