Author: cazfi
Date: Sat Sep  5 11:32:01 2015
New Revision: 29780

URL: http://svn.gna.org/viewcvs/freeciv?rev=29780&view=rev
Log:
Do not save unchanged settings to any savegame.

See patch #6310

Modified:
    branches/S2_6/server/savegame2.c
    branches/S2_6/server/settings.c
    branches/S2_6/server/settings.h

Modified: branches/S2_6/server/savegame2.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/savegame2.c?rev=29780&r1=29779&r2=29780&view=diff
==============================================================================
--- branches/S2_6/server/savegame2.c    (original)
+++ branches/S2_6/server/savegame2.c    Sat Sep  5 11:32:01 2015
@@ -2532,7 +2532,8 @@
   if (saving->scenario) {
     map.server.generator = MAPGEN_SCENARIO; /* We want a scenario. */
   }
-  settings_game_save(saving->file, "settings", saving->scenario);
+
+  settings_game_save(saving->file, "settings");
   /* Restore real map generator. */
   map.server.generator = real_generator;
 

Modified: branches/S2_6/server/settings.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/settings.c?rev=29780&r1=29779&r2=29780&view=diff
==============================================================================
--- branches/S2_6/server/settings.c     (original)
+++ branches/S2_6/server/settings.c     Sat Sep  5 11:32:01 2015
@@ -4022,18 +4022,15 @@
 /********************************************************************
   Save game settings.
 *********************************************************************/
-void settings_game_save(struct section_file *file, const char *section,
-                        bool scenario)
+void settings_game_save(struct section_file *file, const char *section)
 {
   int set_count = 0;
 
   settings_iterate(SSET_ALL, pset) {
     char errbuf[200];
 
-    if ( /* Normal save always has all settings saved */
-        !scenario
-         /* It's explicitly set to some value to save */
-        || setting_get_setdef(pset) == SETDEF_CHANGED
+    if (/* It's explicitly set to some value to save */
+        setting_get_setdef(pset) == SETDEF_CHANGED
          /* It must be same at loading time as it was saving time, even if
           * freeciv's default has changed. */
         || !setting_is_changeable(pset, NULL, errbuf, sizeof(errbuf))) {

Modified: branches/S2_6/server/settings.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/settings.h?rev=29780&r1=29779&r2=29780&view=diff
==============================================================================
--- branches/S2_6/server/settings.h     (original)
+++ branches/S2_6/server/settings.h     Sat Sep  5 11:32:01 2015
@@ -199,8 +199,7 @@
 }
 
 void settings_game_start(void);
-void settings_game_save(struct section_file *file, const char *section,
-                        bool scenario);
+void settings_game_save(struct section_file *file, const char *section);
 void settings_game_load(struct section_file *file, const char *section);
 bool settings_game_reset(void);
 


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

Reply via email to