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

This patch removes the countdown for ceasefire, and so fixes the
request in this ticket. It also makes ceasefire breakable by Republic
and Democracy, and adds some extra text for armistice in the client.

  - Per

Index: server/srv_main.c
===================================================================
--- server/srv_main.c	(revision 12962)
+++ server/srv_main.c	(working copy)
@@ -452,8 +452,8 @@
 }
 
 /**************************************************************************
-  Check for cease-fires and armistices running out; update cancelling 
-  reasons and contact information.
+  Check for armistices running out; update cancelling reasons and contact 
+  information.
 **************************************************************************/
 static void update_diplomatics(void)
 {
@@ -475,50 +475,6 @@
           remove_illegal_armistice_units(plr1, plr2);
         }
       }
-
-      if (state->type == DS_CEASEFIRE) {
-        state->turns_left--;
-        switch(state->turns_left) {
-        case 1:
-          notify_player(plr1, NULL, E_DIPLOMACY,
-                        _("Concerned citizens point out that the cease-fire "
-                          "with %s will run out soon."), plr2->name);
-          notify_player(plr2, NULL, E_DIPLOMACY,
-                        _("Concerned citizens point out that the cease-fire "
-                          "with %s will run out soon."), plr1->name);
-          break;
-        case 0:
-          notify_player(plr1, NULL, E_DIPLOMACY, _("The cease-fire with "
-                        "%s has run out. You are now at war with the %s."),
-                        plr2->name, get_nation_name_plural(plr2->nation));
-          notify_player(plr2, NULL, E_DIPLOMACY, _("The cease-fire with "
-                        "%s has run out. You are now at war with the %s."),
-                        plr1->name, get_nation_name_plural(plr1->nation));
-          state->type = DS_WAR;
-          state2->type = DS_WAR;
-          state->turns_left = 0;
-          state2->turns_left = 0;
-          check_city_workers(plr1);
-          check_city_workers(plr2);
-
-          /* Avoid love-love-hate triangles */
-          players_iterate(plr3) {
-            if (plr3->is_alive && plr3 != plr1 && plr3 != plr2
-                && pplayers_allied(plr3, plr1)
-                && pplayers_allied(plr3, plr2)) {
-              notify_player(plr3, NULL, E_TREATY_BROKEN,
-                            _("Ceasefire between %s and %s has run out. "
-                              "They are at war. You cancel your alliance "
-                              "with both."), plr1->name, plr2->name);
-              plr3->diplstates[plr1->player_no].has_reason_to_cancel = TRUE;
-              plr3->diplstates[plr2->player_no].has_reason_to_cancel = TRUE;
-              handle_diplomacy_cancel_pact(plr3, plr1->player_no, CLAUSE_ALLIANCE);
-              handle_diplomacy_cancel_pact(plr3, plr2->player_no, CLAUSE_ALLIANCE);
-            }
-          } players_iterate_end;
-          break;
-        }
-      }
     } players_iterate_end;
   } players_iterate_end;
 }
Index: server/diplhand.c
===================================================================
--- server/diplhand.c	(revision 12962)
+++ server/diplhand.c	(working copy)
@@ -422,9 +422,7 @@
 	}
       case CLAUSE_CEASEFIRE:
 	pgiver->diplstates[pdest->player_no].type=DS_CEASEFIRE;
-	pgiver->diplstates[pdest->player_no].turns_left = TURNS_LEFT;
 	pdest->diplstates[pgiver->player_no].type=DS_CEASEFIRE;
-	pdest->diplstates[pgiver->player_no].turns_left = TURNS_LEFT;
 	notify_player(pgiver, NULL, E_TREATY_CEASEFIRE,
 			 _("You agree on a cease-fire with %s."),
 			 pdest->name);
Index: common/player.c
===================================================================
--- common/player.c	(revision 12962)
+++ common/player.c	(working copy)
@@ -62,6 +62,7 @@
     return DIPL_ERROR;
   }
   if (p1->diplstates[p2->player_no].has_reason_to_cancel == 0
+      && ds != DS_CEASEFIRE
       && get_player_bonus(p1, EFT_HAS_SENATE) > 0
       && get_player_bonus(p1, EFT_ANY_GOVERNMENT) == 0) {
     return DIPL_SENATE_BLOCKING;
Index: client/text.c
===================================================================
--- client/text.c	(revision 12962)
+++ client/text.c	(working copy)
@@ -116,12 +116,12 @@
     } else if (owner) {
       struct player_diplstate *ds = game.player_ptr->diplstates;
 
-      if (ds[owner->player_no].type == DS_CEASEFIRE) {
+      if (ds[owner->player_no].type == DS_ARMISTICE) {
 	int turns = ds[owner->player_no].turns_left;
 
-	/* TRANS: "Polish territory (5 turn cease-fire)" */
-	astr_add_line(&str, PL_("%s territory (%d turn cease-fire)",
-				"%s territory (%d turn cease-fire)",
+	/* TRANS: "Polish territory (5 turn armistice)" */
+	astr_add_line(&str, PL_("%s territory (%d turn armistice)",
+				"%s territory (%d turn armistice)",
 				turns),
 		      get_nation_name(owner->nation), turns);
       } else {
@@ -151,12 +151,12 @@
     } else {
       struct player_diplstate *ds = game.player_ptr->diplstates;
 
-      if (ds[owner->player_no].type == DS_CEASEFIRE) {
+      if (ds[owner->player_no].type == DS_ARMISTICE) {
 	int turns = ds[owner->player_no].turns_left;
 
-	/* TRANS:  "City: Warsaw (Polish, 5 turn cease-fire)" */
-        astr_add_line(&str, PL_("City: %s (%s, %d turn cease-fire)",
-				"City: %s (%s, %d turn cease-fire)",
+	/* TRANS:  "City: Warsaw (Polish, 5 turn armistice)" */
+        astr_add_line(&str, PL_("City: %s (%s, %d turn armistice)",
+				"City: %s (%s, %d turn armistice)",
 				turns),
 		      pcity->name,
 		      get_nation_name(owner->nation),
@@ -236,12 +236,12 @@
 
       assert(owner != NULL && game.player_ptr != NULL);
 
-      if (ds[owner->player_no].type == DS_CEASEFIRE) {
+      if (ds[owner->player_no].type == DS_ARMISTICE) {
 	int turns = ds[owner->player_no].turns_left;
 
-	/* TRANS:  "Unit: Musketeers (Polish, 5 turn cease-fire)" */
-        astr_add_line(&str, PL_("Unit: %s (%s, %d turn cease-fire)",
-				"Unit: %s (%s, %d turn cease-fire)",
+	/* TRANS:  "Unit: Musketeers (Polish, 5 turn armistice)" */
+        astr_add_line(&str, PL_("Unit: %s (%s, %d turn armistice)",
+				"Unit: %s (%s, %d turn armistice)",
 				turns),
 		      ptype->name,
 		      get_nation_name(owner->nation),
Index: client/plrdlg_common.c
===================================================================
--- client/plrdlg_common.c	(revision 12962)
+++ client/plrdlg_common.c	(working copy)
@@ -119,7 +119,7 @@
 
 /******************************************************************
   Returns a translated string giving the diplomatic status
-  ("war" or "ceasefire (5)").
+  ("war" or "armistice (5)").
 *******************************************************************/
 static const char *col_diplstate(const struct player *player)
 {
@@ -130,7 +130,7 @@
     return "-";
   } else {
     pds = pplayer_get_diplstate(game.player_ptr, player);
-    if (pds->type == DS_CEASEFIRE || pds->type == DS_ARMISTICE) {
+    if (pds->type == DS_ARMISTICE) {
       my_snprintf(buf, sizeof(buf), "%s (%d)",
 		  diplstate_text(pds->type), pds->turns_left);
       return buf;
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to