From 02bed5c0335893542f5f3732ea013ab1ca705c55 Mon Sep 17 00:00:00 2001 From: gfgtdf Date: Mon, 6 Aug 2018 17:44:45 +0200 Subject: [PATCH] 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. --- src/server/game.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/game.cpp b/src/server/game.cpp index 2f28a9ad8175..e0246e218e0e 100644 --- a/src/server/game.cpp +++ b/src/server/game.cpp @@ -1123,6 +1123,7 @@ bool game::process_turn(simple_wml::document& data, const socket_ptr& user) auto message = std::make_unique(); 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");