Author: cazfi
Date: Sat Oct 17 16:52:53 2015
New Revision: 30116

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

See patch #6432

Modified:
    branches/S2_5/server/savegame2.c

Modified: branches/S2_5/server/savegame2.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/savegame2.c?rev=30116&r1=30115&r2=30116&view=diff
==============================================================================
--- branches/S2_5/server/savegame2.c    (original)
+++ branches/S2_5/server/savegame2.c    Sat Oct 17 16:52:53 2015
@@ -2403,9 +2403,15 @@
   }
 
   secfile_insert_bool(saving->file, TRUE, "scenario.is_scenario");
+
+  /* Name is mandatory to the level that is saved even if empty. */
   secfile_insert_str(saving->file, game.scenario.name, "scenario.name");
-  secfile_insert_str(saving->file, game.scenario.description,
-                     "scenario.description");
+
+  if (game.scenario.description[0] != '\0') {
+    secfile_insert_str(saving->file, game.scenario.description,
+                       "scenario.description");
+  }
+
   secfile_insert_bool(saving->file, game.scenario.players, "scenario.players");
   secfile_insert_bool(saving->file, game.scenario.startpos_nations,
                       "scenario.startpos_nations");


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

Reply via email to