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

> [EMAIL PROTECTED] - Sat Dec 01 05:12:21 2007]:
> 
> when a country is split by civil war (after you capture their capital),
> you are given a message in the 'messages' tab. it would be great if
> clicking this took you to the capital you juts captured (so you can see
> where it is), like the warnings about improvments being completed.

Easily done.

-jason

Index: server/citytools.c
===================================================================
--- server/citytools.c	(revision 14109)
+++ server/citytools.c	(working copy)
@@ -1214,6 +1214,7 @@
   struct player *pplayer = unit_owner(punit);
   struct player *cplayer = city_owner(pcity);
   bv_player saw_entering;
+  struct tile *pcity_tile = pcity->tile;
 
   /* If not at war, may peacefully enter city. Or, if we cannot occupy
    * the city, this unit entering will not trigger the effects below. */
@@ -1272,7 +1273,7 @@
 		     pcity->name, pplayer->name);
     remove_city(pcity);
     if (do_civil_war) {
-      civil_war(cplayer);
+      civil_war(cplayer, pcity_tile);
     }
     return;
   }
@@ -1349,7 +1350,7 @@
   send_player_info(pplayer, pplayer); /* Update techs */
 
   if (do_civil_war) {
-    civil_war(cplayer);
+    civil_war(cplayer, pcity_tile);
   }
 }
 
Index: server/plrhand.c
===================================================================
--- server/plrhand.c	(revision 14109)
+++ server/plrhand.c	(working copy)
@@ -1656,8 +1656,11 @@
 ensures that each side gets roughly half, which ones is still 
 determined randomly.
                                    - Kris Bubendorfer
+
+  ptile is the "trigger" tile that is sent to clients with notification.
+  may be NULL.
 ***********************************************************************/
-void civil_war(struct player *pplayer)
+void civil_war(struct player *pplayer, struct tile *ptile)
 {
   int i, j;
   struct player *cplayer;
@@ -1685,7 +1688,7 @@
   freelog(LOG_VERBOSE,
 	  "%s's nation is thrust into civil war, created AI player %s",
 	  pplayer->name, cplayer->name);
-  notify_player(pplayer, NULL, E_CIVIL_WAR,
+  notify_player(pplayer, ptile, E_CIVIL_WAR,
 		   _("Your nation is thrust into civil war, "
 		     " %s is declared the leader of the rebel states."),
 		   cplayer->name);
@@ -1719,7 +1722,7 @@
 
   resolve_unit_stacks(pplayer, cplayer, FALSE);
 
-  notify_player(NULL, NULL, E_CIVIL_WAR,
+  notify_player(NULL, ptile, E_CIVIL_WAR,
 		_("The capture of %s's capital and the destruction "
 		  "of the empire's administrative\n"
 		  "      structures have sparked a civil war.  "
Index: server/plrhand.h
===================================================================
--- server/plrhand.h	(revision 14109)
+++ server/plrhand.h	(working copy)
@@ -99,7 +99,7 @@
   } shuffled_players_iterate_end
 
 bool civil_war_triggered(struct player *pplayer);
-void civil_war(struct player *pplayer);
+void civil_war(struct player *pplayer, struct tile *ptile);
 
 void update_players_after_alliance_breakup(struct player* pplayer,
                                           struct player* pplayer2);
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to