Author: cazfi
Date: Fri Oct 30 22:01:32 2015
New Revision: 30327

URL: http://svn.gna.org/viewcvs/freeciv?rev=30327&view=rev
Log:
Removed any code blocks that were entered on the condition that the savegame 
format version number
is lower than that of freeciv-3.0 from savegame3.c that should never encounter 
such files.

See patch #6503

Modified:
    trunk/server/savegame3.c

Modified: trunk/server/savegame3.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savegame3.c?rev=30327&r1=30326&r2=30327&view=diff
==============================================================================
--- trunk/server/savegame3.c    (original)
+++ trunk/server/savegame3.c    Fri Oct 30 22:01:32 2015
@@ -2707,9 +2707,7 @@
 
     sg_failure_ret(buffer1 != NULL, "%s", secfile_error());
     sg_failure_ret(buffer2 != NULL, "%s", secfile_error());
-    if (loading->version >= 30) {
-      sg_failure_ret(buffer3 != NULL, "%s", secfile_error());
-    }
+    sg_failure_ret(buffer3 != NULL, "%s", secfile_error());
 
     for (x = 0; x < game.map.xsize; x++) {
       char token1[TOKEN_SIZE];
@@ -2740,19 +2738,15 @@
         claimer = index_to_tile(number);
       }
 
-      if (loading->version >= 30) {
-        scanin(&ptr3, ",", token3, sizeof(token3));
-        sg_failure_ret(token3[0] != '\0',
-                       "Map size not correct (map.eowner%d).", y);
-        if (strcmp(token3, "-") == 0) {
-          eowner = NULL;
-        } else {
-          sg_failure_ret(str_to_int(token3, &number),
-                         "Got base owner %s in (%d, %d).", token3, x, y);
-          eowner = player_by_number(number);
-        }
+      scanin(&ptr3, ",", token3, sizeof(token3));
+      sg_failure_ret(token3[0] != '\0',
+                     "Map size not correct (map.eowner%d).", y);
+      if (strcmp(token3, "-") == 0) {
+        eowner = NULL;
       } else {
-        eowner = owner;
+        sg_failure_ret(str_to_int(token3, &number),
+                       "Got base owner %s in (%d, %d).", token3, x, y);
+        eowner = player_by_number(number);
       }
 
       map_claim_ownership(ptile, owner, claimer, FALSE);
@@ -3115,9 +3109,7 @@
     /* Get player color */
     if (!rgbcolor_load(loading->file, &prgbcolor, "player%d.color",
                        pslot_id)) {
-      if (loading->version >= 10 && game_was_started()) {
-        /* 2.4.0 or later savegame. This is not an error in 2.3 savefiles,
-         * as they predate the introduction of configurable player colors. */
+      if (game_was_started()) {
         log_sg("Game has started, yet player %d has no color defined.",
                pslot_id);
         /* This will be fixed up later */
@@ -5867,21 +5859,16 @@
           map_get_player_tile(ptile, plr)->owner = player_by_number(number);
         }
 
-        if (loading->version >= 30) {
-          scanin(&ptr2, ",", token2, sizeof(token2));
-          sg_failure_ret('\0' != token2[0],
-                         "Savegame corrupt - map size not correct.");
-          if (strcmp(token2, "-") == 0) {
-            map_get_player_tile(ptile, plr)->extras_owner = NULL;
-          } else  {
-            sg_failure_ret(str_to_int(token2, &number),
-                           "Savegame corrupt - got extras owner=%s in (%d, 
%d).",
-                           token, x, y);
-            map_get_player_tile(ptile, plr)->extras_owner = 
player_by_number(number);
-          }
-        } else {
-          map_get_player_tile(ptile, plr)->extras_owner
-            = map_get_player_tile(ptile, plr)->owner;
+        scanin(&ptr2, ",", token2, sizeof(token2));
+        sg_failure_ret('\0' != token2[0],
+                       "Savegame corrupt - map size not correct.");
+        if (strcmp(token2, "-") == 0) {
+          map_get_player_tile(ptile, plr)->extras_owner = NULL;
+        } else  {
+          sg_failure_ret(str_to_int(token2, &number),
+                         "Savegame corrupt - got extras owner=%s in (%d, %d).",
+                         token, x, y);
+          map_get_player_tile(ptile, plr)->extras_owner = 
player_by_number(number);
         }
       }
     }


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

Reply via email to