wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src game.cpp playturn.cpp


From: Philippe Plantier
Subject: [Wesnoth-cvs-commits] wesnoth/src game.cpp playturn.cpp
Date: Sun, 24 Apr 2005 07:05:46 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Philippe Plantier <address@hidden>      05/04/24 11:05:46

Modified files:
        src            : game.cpp playturn.cpp 

Log message:
        * Made the "load" menu work in test mode (instead of exiting the game 
due to a
        failed exception).
        
        * Fixed bug #11636: level-specific terrain_graphics being lost when 
saving.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game.cpp.diff?tr1=1.236&tr2=1.237&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playturn.cpp.diff?tr1=1.362&tr2=1.363&r1=text&r2=text

Patches:
Index: wesnoth/src/game.cpp
diff -u wesnoth/src/game.cpp:1.236 wesnoth/src/game.cpp:1.237
--- wesnoth/src/game.cpp:1.236  Sat Apr 23 15:39:58 2005
+++ wesnoth/src/game.cpp        Sun Apr 24 11:05:45 2005
@@ -1,4 +1,4 @@
-/* $Id: game.cpp,v 1.236 2005/04/23 15:39:58 gruikya Exp $ */
+/* $Id: game.cpp,v 1.237 2005/04/24 11:05:45 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -546,14 +546,28 @@
 
 bool game_controller::play_test()
 {
+       static bool first_time = true;
+
        if(test_mode_ == false) {
                return true;
        }
+       if(!first_time)
+               return false;
+
+       first_time = false;
 
        state_.campaign_type = "test";
        state_.scenario = "test";
 
-       ::play_game(disp(),state_,game_config_,units_data_,video_);
+       try {
+               ::play_game(disp(),state_,game_config_,units_data_,video_);
+       } catch(game::load_game_exception& e) {
+               loaded_game_ = e.game;
+               loaded_game_show_replay_ = e.show_replay;
+
+               return true;
+       }
+
        return false;
 }
 
Index: wesnoth/src/playturn.cpp
diff -u wesnoth/src/playturn.cpp:1.362 wesnoth/src/playturn.cpp:1.363
--- wesnoth/src/playturn.cpp:1.362      Sat Apr 23 12:13:10 2005
+++ wesnoth/src/playturn.cpp    Sun Apr 24 11:05:45 2005
@@ -1,4 +1,4 @@
-/* $Id: playturn.cpp,v 1.362 2005/04/23 12:13:10 gruikya Exp $ */
+/* $Id: playturn.cpp,v 1.363 2005/04/24 11:05:45 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -1666,6 +1666,14 @@
        status_.write(start);
        game_events::write_events(start);
 
+       // Write terrain_graphics data in snapshot, too
+       const config::child_list& terrains = 
level_.get_children("terrain_graphics");
+       for(config::child_list::const_iterator tg = terrains.begin();
+                       tg != terrains.end(); ++tg) {
+
+               start.add_child("terrain_graphics", **tg);
+       }
+
        write_game(state_of_game_,start,WRITE_SNAPSHOT_ONLY);
 
        // Clobber gold values to make sure the snapshot uses the values




reply via email to

[Prev in Thread] Current Thread [Next in Thread]