Author: cazfi
Date: Sat Oct 17 16:52:40 2015
New Revision: 30114

URL: http://svn.gna.org/viewcvs/freeciv?rev=30114&view=rev
Log:
If scenario has no description, do not save empty description.

See patch #6432

Modified:
    trunk/server/savegame3.c

Modified: trunk/server/savegame3.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savegame3.c?rev=30114&r1=30113&r2=30114&view=diff
==============================================================================
--- trunk/server/savegame3.c    (original)
+++ trunk/server/savegame3.c    Sat Oct 17 16:52:40 2015
@@ -2239,11 +2239,18 @@
   }
 
   secfile_insert_bool(saving->file, TRUE, "scenario.is_scenario");
+
+  /* Name is mandatory to the level that is saved even if empty. */
   mod_entry = secfile_insert_str(saving->file, game.scenario.name, 
"scenario.name");
   entry_str_set_gt_marking(mod_entry, TRUE);
-  mod_entry = secfile_insert_str(saving->file, game.scenario.description,
-                                 "scenario.description");
-  entry_str_set_gt_marking(mod_entry, TRUE);
+
+  /* Description is saved only if it exist */
+  if (game.scenario.description[0] != '\0') {
+    mod_entry = secfile_insert_str(saving->file, game.scenario.description,
+                                   "scenario.description");
+    entry_str_set_gt_marking(mod_entry, TRUE);
+  }
+
   secfile_insert_bool(saving->file, game.scenario.save_random, 
"scenario.save_random");
   secfile_insert_bool(saving->file, game.scenario.players, "scenario.players");
   secfile_insert_bool(saving->file, game.scenario.startpos_nations,


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

Reply via email to