From 17b3c98a5e1237decc96631a7ed22250754ab517 Mon Sep 17 00:00:00 2001 From: gfgtdf Date: Wed, 16 Sep 2015 16:16:55 +0200 Subject: [PATCH] fix side_for in [message]s with input the previous impleentation could casue OOS. --- src/game_events/action_wml.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/game_events/action_wml.cpp b/src/game_events/action_wml.cpp index dd62fe3e0c5..109374b5012 100644 --- a/src/game_events/action_wml.cpp +++ b/src/game_events/action_wml.cpp @@ -584,13 +584,11 @@ WML_HANDLER_FUNCTION(message, event_info, cfg) } // Check if this message is for this side + // handeling of side_for for messages with input is done below in the get_user_choice call std::string side_for_raw = cfg["side_for"]; - if (!side_for_raw.empty()) - { - /* Always ignore side_for when the message has some input - boxes, but display the error message only if side_for is - used for an inactive side. */ - bool side_for_show = has_input; + if (!side_for_raw.empty() && !has_input) + {. + bool side_for_show = false; std::vector side_for = utils::split(side_for_raw, ',', utils::STRIP_SPACES | utils::REMOVE_EMPTY);