Author: cazfi
Date: Wed Aug 19 21:34:29 2015
New Revision: 29591

URL: http://svn.gna.org/viewcvs/freeciv?rev=29591&view=rev
Log:
Made game.server.save_options.save_random to affect scenario saving only.
Set it to FALSE when loading scenario that does not have random state included.

See bug #23793

Modified:
    branches/S2_5/server/savegame.c
    branches/S2_5/server/savegame2.c

Modified: branches/S2_5/server/savegame.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/savegame.c?rev=29591&r1=29590&r2=29591&view=diff
==============================================================================
--- branches/S2_5/server/savegame.c     (original)
+++ branches/S2_5/server/savegame.c     Wed Aug 19 21:34:29 2015
@@ -4094,6 +4094,10 @@
     /* mark it */
     (void) secfile_entry_by_path(file, "game.save_random");
 
+    /* Since random state was not previously saved, do not save it when 
resaving
+     * scenario either. */
+    game.server.save_options.save_random = FALSE;
+
     /* We're loading a running game without a seed (which is okay, if it's
      * a scenario).  We need to generate the game seed now because it will
      * be needed later during the load. */

Modified: branches/S2_5/server/savegame2.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/savegame2.c?rev=29591&r1=29590&r2=29591&view=diff
==============================================================================
--- branches/S2_5/server/savegame2.c    (original)
+++ branches/S2_5/server/savegame2.c    Wed Aug 19 21:34:29 2015
@@ -2246,6 +2246,10 @@
     /* No random values - mark the setting. */
     (void) secfile_entry_by_path(loading->file, "random.save");
 
+    /* Since random state was not previously saved, do not save it when 
resaving
+     * scenario either. */
+    game.server.save_options.save_random = FALSE;
+
     /* We're loading a game without a seed (which is okay, if it's a scenario).
      * We need to generate the game seed now because it will be needed later
      * during the load. */
@@ -2262,7 +2266,7 @@
   /* Check status and return if not OK (sg_success != TRUE). */
   sg_check_ret();
 
-  if (fc_rand_is_init() && game.server.save_options.save_random) {
+  if (fc_rand_is_init() && (!saving->scenario || 
game.server.save_options.save_random)) {
     int i;
     RANDOM_STATE rstate = fc_rand_state();
 


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to