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

ups - missed a '_'. Version 2 of the patch attached 

Matthias

diff -ur -X./freeciv-2.1.99svn15393/diff_ignore freeciv-2.1.99svn15393/common/game.c freeciv-2.1.99svn.patch_noend/common/game.c
--- freeciv-2.1.99svn15393/common/game.c	2009-01-05 11:54:25.000000000 +0100
+++ freeciv-2.1.99svn.patch_noend/common/game.c	2009-01-05 13:46:39.000000000 +0100
@@ -284,6 +284,7 @@
   game.info.techpenalty   = GAME_DEFAULT_TECHPENALTY;
   game.info.razechance    = GAME_DEFAULT_RAZECHANCE;
   game.info.spacerace     = GAME_DEFAULT_SPACERACE;
+  game.info.endspaceship  = GAME_DEFAULT_END_SPACESHIP;
   game.info.turnblock     = GAME_DEFAULT_TURNBLOCK;
   game.info.fogofwar      = GAME_DEFAULT_FOGOFWAR;
   game.info.borders_sq    = GAME_DEFAULT_BORDERS;
diff -ur -X./freeciv-2.1.99svn15393/diff_ignore freeciv-2.1.99svn15393/common/game.h freeciv-2.1.99svn.patch_noend/common/game.h
--- freeciv-2.1.99svn15393/common/game.h	2009-01-05 11:54:25.000000000 +0100
+++ freeciv-2.1.99svn.patch_noend/common/game.h	2009-01-05 11:44:03.000000000 +0100
@@ -270,6 +270,7 @@
 #define GAME_DEFAULT_SCORETURN       20
 
 #define GAME_DEFAULT_SPACERACE       TRUE
+#define GAME_DEFAULT_END_SPACESHIP   TRUE
 
 #define GAME_DEFAULT_TURNBLOCK       TRUE
 
diff -ur -X./freeciv-2.1.99svn15393/diff_ignore freeciv-2.1.99svn15393/common/packets.def freeciv-2.1.99svn.patch_noend/common/packets.def
--- freeciv-2.1.99svn15393/common/packets.def	2009-01-05 11:54:25.000000000 +0100
+++ freeciv-2.1.99svn.patch_noend/common/packets.def	2009-01-05 11:44:01.000000000 +0100
@@ -409,6 +409,7 @@
   UINT8 occupychance;
   BOOL autoattack;
   BOOL spacerace;
+  BOOL endspaceship;
   UINT8 aqueductloss;
   UINT8 killcitizen;
   UINT8 razechance;
Only in freeciv-2.1.99svn.patch_noend: freeciv-2.1.99svn
diff -ur -X./freeciv-2.1.99svn15393/diff_ignore freeciv-2.1.99svn15393/server/savegame.c freeciv-2.1.99svn.patch_noend/server/savegame.c
--- freeciv-2.1.99svn15393/server/savegame.c	2009-01-05 11:54:33.000000000 +0100
+++ freeciv-2.1.99svn.patch_noend/server/savegame.c	2009-01-05 11:44:00.000000000 +0100
@@ -4346,6 +4346,9 @@
 
     game.info.spacerace = secfile_lookup_bool_default(file, game.info.spacerace,
 						"game.spacerace");
+    game.info.endspaceship =
+      secfile_lookup_bool_default(file, game.info.endspaceship,
+                                  "game.endspaceship");
 
     game.info.auto_ai_toggle = 
       secfile_lookup_bool_default(file, game.info.auto_ai_toggle, 
@@ -4925,6 +4928,7 @@
 
   secfile_insert_bool(file, game.info.fogofwar, "game.fogofwar");
   secfile_insert_bool(file, game.info.spacerace, "game.spacerace");
+  secfile_insert_bool(file, game.info.endspaceship, "game.endspaceship");
   secfile_insert_bool(file, game.info.auto_ai_toggle, "game.auto_ai_toggle");
   secfile_insert_int(file, game.info.diplchance, "game.diplchance");
   secfile_insert_int(file, game.info.aqueductloss, "game.aqueductloss");
diff -ur -X./freeciv-2.1.99svn15393/diff_ignore freeciv-2.1.99svn15393/server/settings.c freeciv-2.1.99svn.patch_noend/server/settings.c
--- freeciv-2.1.99svn15393/server/settings.c	2009-01-05 11:54:33.000000000 +0100
+++ freeciv-2.1.99svn.patch_noend/server/settings.c	2009-01-05 12:07:59.000000000 +0100
@@ -803,6 +803,13 @@
 	   NULL, 
 	   GAME_DEFAULT_SPACERACE)
 
+  GEN_BOOL("endspaceship", game.info.endspaceship, SSET_RULES_FLEXIBLE,
+           SSET_SCIENCE, SSET_VITAL, SSET_TO_CLIENT,
+           N_("Should the game end if the spaceship arrives?"),
+           N_("If this option is set to 1, the game will end with the "
+              "arrival of a spaceship at Alpha Centauri."), NULL,
+           GAME_DEFAULT_END_SPACESHIP)
+
   GEN_INT("civilwarsize", game.info.civilwarsize,
 	  SSET_RULES_FLEXIBLE, SSET_SOCIOLOGY, SSET_RARE, SSET_TO_CLIENT,
 	  N_("Minimum number of cities for civil war"),
diff -ur -X./freeciv-2.1.99svn15393/diff_ignore freeciv-2.1.99svn15393/server/srv_main.c freeciv-2.1.99svn.patch_noend/server/srv_main.c
--- freeciv-2.1.99svn15393/server/srv_main.c	2009-01-05 11:54:33.000000000 +0100
+++ freeciv-2.1.99svn.patch_noend/server/srv_main.c	2009-01-05 12:04:17.000000000 +0100
@@ -268,6 +268,11 @@
                   _("The %s spaceship has arrived at Alpha Centauri."),
                   nation_adjective_for_player(victor));
 
+    if (!game.info.endspaceship) {
+      /* games does not end on spaceship arrival */
+      return FALSE;
+    }
+
     /* this guy has won, now check if anybody else wins with him */
     players_iterate(pplayer) {
       if (pplayer->team == victor->team && pplayer != victor) {
@@ -322,7 +327,7 @@
 	}
       } players_iterate_end;
       ggz_report_victory();
-      return TRUE;
+      return win; /* TRUE */
     }
   } team_iterate_end;
 
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to