Author: soliton
Date: Fri Apr 17 21:24:05 2009
New Revision: 34990

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34990&view=rev
Log:
small tweak for the case of an empty history

Modified:
    trunk/src/server/game.cpp

Modified: trunk/src/server/game.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/game.cpp?rev=34990&r1=34989&r2=34990&view=diff
==============================================================================
--- trunk/src/server/game.cpp (original)
+++ trunk/src/server/game.cpp Fri Apr 17 21:24:05 2009
@@ -1217,7 +1217,7 @@
 }
 
 void game::save_replay() {
-       if (!save_replays_ || !started_) return;
+       if (!save_replays_ || !started_ || history_.empty()) return;
 
        std::string replay_commands;
        for(std::vector<simple_wml::document*>::iterator i = history_.begin();
@@ -1265,6 +1265,7 @@
 }
 
 void game::clear_history() {
+       if (history_.empty()) return;
        for(std::vector<simple_wml::document*>::iterator i = history_.begin(); 
i != history_.end(); ++i) {
                delete *i;
        }


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

Reply via email to