Author: shadowmaster
Date: Fri Mar 27 01:53:09 2009
New Revision: 34175

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34175&view=rev
Log:
Port 34149 from trunk (make saved games of stable releases be always
compatible among different releases of the same stable series).

Modified:
    trunk/src/game.cpp

Modified: trunk/src/game.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game.cpp?rev=34175&r1=34174&r2=34175&view=diff
==============================================================================
--- trunk/src/game.cpp (original)
+++ trunk/src/game.cpp Fri Mar 27 01:53:09 2009
@@ -925,20 +925,25 @@
 
                const std::string version = cfg["version"];
                if(version != game_config::version) {
-                       // do not load if too old, if either the savegame or 
the current game
-                       // has the version 'test' allow loading
-                       
if(!game_config::is_compatible_savegame_version(version)) {
-                               /* GCC-3.3 needs a temp var otherwise 
compilation fails */
-                               gui::message_dialog dlg(disp(), "", _("This 
save is from a version too old to be loaded."));
-                               dlg.show();
-                               return false;
-                       }
-
-                       const int res = gui::dialog(disp(),"",
-                                             _("This save is from a different 
version of the game. Do you want to try to load it?"),
-                                             gui::YES_NO).show();
-                       if(res == 1) {
-                               return false;
+                       const version_info parsed_savegame_version(version);
+                       if(game_config::wesnoth_version.minor_version() % 2 != 
0 ||
+                          game_config::wesnoth_version.major_version() != 
parsed_savegame_version.major_version() ||
+                          game_config::wesnoth_version.minor_version() != 
parsed_savegame_version.minor_version()) {
+                               // do not load if too old, if either the 
savegame or the current game
+                               // has the version 'test' allow loading
+                               
if(!game_config::is_compatible_savegame_version(version)) {
+                                       /* GCC-3.3 needs a temp var otherwise 
compilation fails */
+                                       gui::message_dialog dlg(disp(), "", 
_("This save is from a version too old to be loaded."));
+                                       dlg.show();
+                                       return false;
+                               }
+
+                               const int res = gui::dialog(disp(),"",
+                                                                       _("This 
save is from a different version of the game. Do you want to try to load it?"),
+                                                                       
gui::YES_NO).show();
+                               if(res == 1) {
+                                       return false;
+                               }
                        }
                }
 


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to