mail[Wesnoth-commits] r34149 - /branches/1.6/src/game.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by shadowm2006 on March 26, 2009 - 17:16:
Author: shadowmaster
Date: Thu Mar 26 17:16:29 2009
New Revision: 34149

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34149&view=rev
Log:
Quick and dirty fix for a problem reported by Soliton:

Saved games of the same stable line as the engine are always compatible,
no matter what the Z component (in a X.Y.Z version scheme) is.

Testing later...

Modified:
    branches/1.6/src/game.cpp

Modified: branches/1.6/src/game.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/src/game.cpp?rev=34149&r1=34148&r2=34149&view=diff
==============================================================================
--- branches/1.6/src/game.cpp (original)
+++ branches/1.6/src/game.cpp Thu Mar 26 17:16:29 2009
@@ -929,20 +929,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;
+                               }
                        }
                }
 




Related Messages


Powered by MHonArc, Updated Thu Mar 26 18:00:37 2009