[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src replay.cpp replay.hpp
From: |
Philippe Plantier |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src replay.cpp replay.hpp |
Date: |
Sun, 17 Apr 2005 09:18:34 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Philippe Plantier <address@hidden> 05/04/17 13:18:34
Modified files:
src : replay.cpp replay.hpp
Log message:
Fixed bug #12714, or at least, one of the elements which seems to be
the cause
of bug #12714: Chat messages during fights corrupted the replay and
caused OoS
(apparently, this bug had been here for a long time)
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/replay.cpp.diff?tr1=1.104&tr2=1.105&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/replay.hpp.diff?tr1=1.33&tr2=1.34&r1=text&r2=text
Patches:
Index: wesnoth/src/replay.cpp
diff -u wesnoth/src/replay.cpp:1.104 wesnoth/src/replay.cpp:1.105
--- wesnoth/src/replay.cpp:1.104 Wed Mar 30 19:48:17 2005
+++ wesnoth/src/replay.cpp Sun Apr 17 13:18:34 2005
@@ -1,4 +1,4 @@
-/* $Id: replay.cpp,v 1.104 2005/03/30 19:48:17 gruikya Exp $ */
+/* $Id: replay.cpp,v 1.105 2005/04/17 13:18:34 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -361,7 +361,7 @@
void replay::speak(const config& cfg)
{
- config* const cmd = add_command();
+ config* const cmd = add_command(false);
if(cmd != NULL) {
cmd->add_child("speak",cfg);
(*cmd)["undo"] = "no";
@@ -442,11 +442,12 @@
}
}
-config* replay::add_command()
+config* replay::add_command(bool update_random_context)
{
pos_ = ncommands()+1;
current_ = &cfg_.add_child("command");
- random_ = current_;
+ if(update_random_context)
+ random_ = current_;
return current_;
}
Index: wesnoth/src/replay.hpp
diff -u wesnoth/src/replay.hpp:1.33 wesnoth/src/replay.hpp:1.34
--- wesnoth/src/replay.hpp:1.33 Mon Mar 28 19:08:58 2005
+++ wesnoth/src/replay.hpp Sun Apr 17 13:18:34 2005
@@ -1,4 +1,4 @@
-/* $Id: replay.hpp,v 1.33 2005/03/28 19:08:58 gruikya Exp $ */
+/* $Id: replay.hpp,v 1.34 2005/04/17 13:18:34 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -99,7 +99,18 @@
void add_value(const std::string& type, int value);
const config::child_list& commands() const;
- config* add_command();
+ /** Adds a new empty command to the command list.
+ *
+ * @param update_random_context If set to false, do not update the
+ * random context variables: all random generation will take
+ * place in the previous random context. Used for commands
+ * for which "random context" is pointless, and which can be
+ * issued while some other commands are still taking place,
+ * like, for example, messages during combats.
+ *
+ * @return a pointer to the added command
+ */
+ config* add_command(bool update_random_context=true);
config cfg_;
unsigned int pos_;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src replay.cpp replay.hpp,
Philippe Plantier <=