Author: soliton
Date: Fri Apr 17 21:21:04 2009
New Revision: 34989

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

Modified:
    branches/1.6/src/server/game.cpp

Modified: branches/1.6/src/server/game.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/src/server/game.cpp?rev=34989&r1=34988&r2=34989&view=diff
==============================================================================
--- branches/1.6/src/server/game.cpp (original)
+++ branches/1.6/src/server/game.cpp Fri Apr 17 21:21:04 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