Author: cazfi
Date: Mon May  9 00:20:38 2016
New Revision: 32624

URL: http://svn.gna.org/viewcvs/freeciv?rev=32624&view=rev
Log:
Store scenario format version of pre-3.0 scenarios correctly to the list of
available scenarios in gtk-clients.

See bug #24638

Modified:
    trunk/client/gui-gtk-2.0/pages.c
    trunk/client/gui-gtk-3.0/pages.c
    trunk/client/gui-gtk-3.x/pages.c

Modified: trunk/client/gui-gtk-2.0/pages.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-2.0/pages.c?rev=32624&r1=32623&r2=32624&view=diff
==============================================================================
--- trunk/client/gui-gtk-2.0/pages.c    (original)
+++ trunk/client/gui-gtk-2.0/pages.c    Mon May  9 00:20:38 2016
@@ -1,4 +1,4 @@
-/**********************************************************************
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -2930,6 +2930,12 @@
       int current_ver = MAJOR_VERSION * 1000000 + MINOR_VERSION * 10000;
 
       fcver = secfile_lookup_int_default(sf, 0, "scenario.game_version");
+      if (fcver < 30000) {
+        /* Pre-3.0 versions stored version number without emergency version
+         * part in the end. To get comparable version number stored,
+         * multiply by 100. */
+        fcver *= 100;
+      }
       fcver -= (fcver % 10000); /* Patch level does not affect compatibility */
       sname = secfile_lookup_str_default(sf, NULL, "scenario.name");
       sdescription = secfile_lookup_str_default(sf, NULL,

Modified: trunk/client/gui-gtk-3.0/pages.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/pages.c?rev=32624&r1=32623&r2=32624&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.0/pages.c    (original)
+++ trunk/client/gui-gtk-3.0/pages.c    Mon May  9 00:20:38 2016
@@ -1,4 +1,4 @@
-/**********************************************************************
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -3000,6 +3000,12 @@
       int current_ver = MAJOR_VERSION * 1000000 + MINOR_VERSION * 10000;
 
       fcver = secfile_lookup_int_default(sf, 0, "scenario.game_version");
+      if (fcver < 30000) {
+        /* Pre-3.0 versions stored version number without emergency version
+         * part in the end. To get comparable version number stored,
+         * multiply by 100. */
+        fcver *= 100;
+      }
       fcver -= (fcver % 10000); /* Patch level does not affect compatibility */
       sname = secfile_lookup_str_default(sf, NULL, "scenario.name");
       sdescription = secfile_lookup_str_default(sf, NULL,

Modified: trunk/client/gui-gtk-3.x/pages.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.x/pages.c?rev=32624&r1=32623&r2=32624&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.x/pages.c    (original)
+++ trunk/client/gui-gtk-3.x/pages.c    Mon May  9 00:20:38 2016
@@ -1,4 +1,4 @@
-/**********************************************************************
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -3000,6 +3000,12 @@
       int current_ver = MAJOR_VERSION * 1000000 + MINOR_VERSION * 10000;
 
       fcver = secfile_lookup_int_default(sf, 0, "scenario.game_version");
+      if (fcver < 30000) {
+        /* Pre-3.0 versions stored version number without emergency version
+         * part in the end. To get comparable version number stored,
+         * multiply by 100. */
+        fcver *= 100;
+      }
       fcver -= (fcver % 10000); /* Patch level does not affect compatibility */
       sname = secfile_lookup_str_default(sf, NULL, "scenario.name");
       sdescription = secfile_lookup_str_default(sf, NULL,


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

Reply via email to