fix oos when undoing after ally chat

previously the server would send [speak] commands that had no undo=no attributes so that the game would remove the speak command from the replay instead of the actual undoable action when undoing an action.
This commit is contained in:
gfgtdf 2018-08-06 17:44:45 +02:00
parent 7bf37a1e64
commit 02bed5c033

View file

@ -1123,6 +1123,7 @@ bool game::process_turn(simple_wml::document& data, const socket_ptr& user)
auto message = std::make_unique<simple_wml::document>();
simple_wml::node& message_turn = message->root().add_child("turn");
simple_wml::node& message_turn_command = message_turn.add_child("command");
message_turn_command.set_attr("undo", "no");
speak->copy_into(message_turn_command.add_child("speak"));
if(to_sides.empty()) {
@ -1996,6 +1997,7 @@ void game::send_server_message(const char* message, const socket_ptr& sock, simp
if(started_) {
simple_wml::node& cmd = doc.root().add_child("turn");
simple_wml::node& cfg = cmd.add_child("command");
cmd.set_attr("undo", "no");
simple_wml::node& msg = cfg.add_child("speak");
msg.set_attr("id", "server");