Skip to content

Commit

Permalink
fix oos when undoing after ally chat
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gfgtdf committed Aug 13, 2018
1 parent 7bf37a1 commit 02bed5c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/server/game.cpp
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 02bed5c

Please sign in to comment.