Author: cazfi
Date: Mon Sep 26 09:26:50 2016
New Revision: 33897

URL: http://svn.gna.org/viewcvs/freeciv?rev=33897&view=rev
Log:
Replaced leader "Sex" with "Kind" in savegame3.c

See patch #7614

Modified:
    trunk/server/savecompat.c
    trunk/server/savegame3.c

Modified: trunk/server/savecompat.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savecompat.c?rev=33897&r1=33896&r2=33897&view=diff
==============================================================================
--- trunk/server/savecompat.c   (original)
+++ trunk/server/savecompat.c   Mon Sep 26 09:26:50 2016
@@ -1736,6 +1736,19 @@
 
   if (game_version < 2930000) {
     /* Since version number bump to 2.92.99 */
+    player_slots_iterate(pslot) {
+      int plrno = player_slot_index(pslot);
+
+      if (secfile_section_lookup(loading->file, "player%d", plrno) == NULL) {
+        continue;
+      }
+
+      if (secfile_entry_lookup(loading->file, "player%d.kind", plrno) == NULL) 
{
+       const char *kind = secfile_lookup_str_default(loading->file, "male", 
"player%d.sex", plrno);
+
+       secfile_insert_str(loading->file, kind, "player%d.kind", plrno);
+      }
+    } player_slots_iterate_end;
   }
 #endif /* FREECIV_DEV_SAVE_COMPAT_3_0 */
 }

Modified: trunk/server/savegame3.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savegame3.c?rev=33897&r1=33896&r2=33897&view=diff
==============================================================================
--- trunk/server/savegame3.c    (original)
+++ trunk/server/savegame3.c    Mon Sep 26 09:26:50 2016
@@ -3581,7 +3581,7 @@
   const char *level;
   const char *barb_str;
   size_t nval;
-  const char *sex;
+  const char *kind;
 
   /* Check status and return if not OK (sg_success != TRUE). */
   sg_check_ret();
@@ -3771,8 +3771,8 @@
   sg_failure_ret(secfile_lookup_int(loading->file, &plr->nturns_idle,
                                     "player%d.idle_turns", plrno),
                  "%s", secfile_error());
-  sex = secfile_lookup_str(loading->file, "player%d.sex", plrno);
-  if (!strcmp("male", sex)) {
+  kind = secfile_lookup_str(loading->file, "player%d.kind", plrno);
+  if (!strcmp("male", kind)) {
     plr->is_male = TRUE;
   } else {
     plr->is_male = FALSE;
@@ -4105,10 +4105,10 @@
                      "player%d.idle_turns", plrno);
   if (plr->is_male) {
     secfile_insert_str(saving->file, "male",
-                       "player%d.sex", plrno);
+                       "player%d.kind", plrno);
   } else {
     secfile_insert_str(saving->file, "female",
-                       "player%d.sex", plrno);
+                       "player%d.kind", plrno);
   }
   secfile_insert_bool(saving->file, plr->is_alive,
                       "player%d.is_alive", plrno);


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

Reply via email to