Author: cazfi
Date: Tue Aug 18 18:34:38 2015
New Revision: 29579

URL: http://svn.gna.org/viewcvs/freeciv?rev=29579&view=rev
Log:
Do not save research data when players are not saved to scenario at all.

See bug #23792

Modified:
    branches/S2_6/server/savegame2.c

Modified: branches/S2_6/server/savegame2.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/savegame2.c?rev=29579&r1=29578&r2=29579&view=diff
==============================================================================
--- branches/S2_6/server/savegame2.c    (original)
+++ branches/S2_6/server/savegame2.c    Tue Aug 18 18:34:38 2015
@@ -6598,36 +6598,38 @@
   /* Check status and return if not OK (sg_success != TRUE). */
   sg_check_ret();
 
-  researches_iterate(presearch) {
-    secfile_insert_int(saving->file, research_number(presearch),
-                       "research.r%d.number", i);
-    technology_save(saving->file, "research.r%d.goal",
-                    i, presearch->tech_goal);
-    secfile_insert_int(saving->file, presearch->techs_researched,
-                       "research.r%d.techs", i);
-    secfile_insert_int(saving->file, presearch->future_tech,
-                       "research.r%d.futuretech", i);
-    secfile_insert_int(saving->file, presearch->bulbs_researching_saved,
-                       "research.r%d.bulbs_before", i);
-    technology_save(saving->file, "research.r%d.saved",
-                    i, presearch->researching_saved);
-    secfile_insert_int(saving->file, presearch->bulbs_researched,
-                       "research.r%d.bulbs", i);
-    technology_save(saving->file, "research.r%d.now",
-                    i, presearch->researching);
-    secfile_insert_bool(saving->file, presearch->got_tech,
-                        "research.r%d.got_tech", i);
-    /* Save technology lists as bytevector. Note that technology order is
-     * saved in savefile.technology.order */
-    advance_index_iterate(A_NONE, tech_id) {
-      invs[tech_id] = (research_invention_state(presearch, tech_id)
-                       == TECH_KNOWN ? '1' : '0');
-    } advance_index_iterate_end;
-    invs[game.control.num_tech_types] = '\0';
-    secfile_insert_str(saving->file, invs, "research.r%d.done", i);
-    i++;
-  } researches_iterate_end;
-  secfile_insert_int(saving->file, i, "research.count");
+  if (saving->save_players) {
+    researches_iterate(presearch) {
+      secfile_insert_int(saving->file, research_number(presearch),
+                         "research.r%d.number", i);
+      technology_save(saving->file, "research.r%d.goal",
+                      i, presearch->tech_goal);
+      secfile_insert_int(saving->file, presearch->techs_researched,
+                         "research.r%d.techs", i);
+      secfile_insert_int(saving->file, presearch->future_tech,
+                         "research.r%d.futuretech", i);
+      secfile_insert_int(saving->file, presearch->bulbs_researching_saved,
+                         "research.r%d.bulbs_before", i);
+      technology_save(saving->file, "research.r%d.saved",
+                      i, presearch->researching_saved);
+      secfile_insert_int(saving->file, presearch->bulbs_researched,
+                         "research.r%d.bulbs", i);
+      technology_save(saving->file, "research.r%d.now",
+                      i, presearch->researching);
+      secfile_insert_bool(saving->file, presearch->got_tech,
+                          "research.r%d.got_tech", i);
+      /* Save technology lists as bytevector. Note that technology order is
+       * saved in savefile.technology.order */
+      advance_index_iterate(A_NONE, tech_id) {
+        invs[tech_id] = (research_invention_state(presearch, tech_id)
+                         == TECH_KNOWN ? '1' : '0');
+      } advance_index_iterate_end;
+      invs[game.control.num_tech_types] = '\0';
+      secfile_insert_str(saving->file, invs, "research.r%d.done", i);
+      i++;
+    } researches_iterate_end;
+    secfile_insert_int(saving->file, i, "research.count");
+  }
 }
 
 /* =======================================================================


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

Reply via email to