mail[Wesnoth-commits] r33543 - in /trunk: changelog src/gamestatus.cpp


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

Header


Content

Posted by joerg . hinrichs on March 11, 2009 - 01:22:
Author: jhinrichs
Date: Wed Mar 11 00:22:00 2009
New Revision: 33543

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33543&view=rev
Log:
Fixes bug #13139 (Campaign replay saved after loading a savegame are broken 
(no recall)).

Modified:
    trunk/changelog
    trunk/src/gamestatus.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=33543&r1=33542&r2=33543&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Wed Mar 11 00:22:00 2009
@@ -1,4 +1,4 @@
-Version 1.5.13+svn:
+Version 1.5.13+svn:
  * Graphics:
    * New portrait for the female Assassin, Gryphon Rider.
  * Language and i18n:
@@ -8,6 +8,8 @@
  * User interface:
    * Fix an assertion failure when an unexpected mouse button was used
      (bug #13126)
+ * Miscellaneous and bug fixes:
+   * Fix another campaign replay bug (#13139)
 
 Version 1.5.13:
  * Graphics:

Modified: trunk/src/gamestatus.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gamestatus.cpp?rev=33543&r1=33542&r2=33543&view=diff
==============================================================================
--- trunk/src/gamestatus.cpp (original)
+++ trunk/src/gamestatus.cpp Wed Mar 11 00:22:00 2009
@@ -486,6 +486,7 @@
        log_scope("read_game");
 
        const config* snapshot = cfg.child("snapshot");
+       const config* replay_start = cfg.child("replay_start");
 
        // We have to load era id for MP games so they can load correct era.
 
@@ -502,7 +503,22 @@
        } else {
                // Start of scenario save, replays and MP campaign network 
next scenario
                // have the recall list stored in root of the config.
-               load_recall_list(cfg.get_children("player"));
+               // Edit: 
+               // Unfortunately, the replay savegame format is not 
homogeneous. Some savegames
+               // have the player information stored in the starting 
position, others in the
+               // root of the config. If the starting position player 
information is available
+               // it will be preferred.
+               if (replay_start != NULL){
+                       // Check if we find some player information in the 
starting position
+                       const config::child_list& cfg_players = 
(*replay_start).get_children("player");
+                       if (!cfg_players.empty())
+                               load_recall_list(cfg_players);
+                       else
+                               load_recall_list(cfg.get_children("player"));
+               }
+               else{
+                       load_recall_list(cfg.get_children("player"));
+               }
        }
 
        LOG_NG << "scenario: '" << scenario << "'\n";
@@ -527,7 +543,6 @@
                replay_data = *replay;
        }
 
-       const config* replay_start = cfg.child("replay_start");
        if(replay_start != NULL) {
                starting_pos = *replay_start;
                //This is a quick hack to make replays for campaigns work 
again:




Related Messages


Powered by MHonArc, Updated Wed Mar 11 06:20:45 2009