Skip to content

Commit

Permalink
enable [message] side_for key with options
Browse files Browse the repository at this point in the history
or text input.

Note that if used together with text_input side_for cannot be a list,
only a single number.
  • Loading branch information
gfgtdf committed Jun 21, 2014
1 parent 0b5c814 commit 7418818
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/game_events/action_wml.cpp
Expand Up @@ -1000,8 +1000,6 @@ WML_HANDLER_FUNCTION(message, event_info, cfg)
boxes, but display the error message only if side_for is
used for an inactive side. */
bool side_for_show = has_input;
if (has_input && side_for_raw != str_cast(resources::controller->current_side()))
lg::wml_error << "[message]side_for= cannot query any user input out of turn.\n";

std::vector<std::string> side_for =
utils::split(side_for_raw, ',', utils::STRIP_SPACES | utils::REMOVE_EMPTY);
Expand Down Expand Up @@ -1082,7 +1080,7 @@ WML_HANDLER_FUNCTION(message, event_info, cfg)
}
else
{
config choice = mp_sync::get_user_choice("input", msg);
config choice = mp_sync::get_user_choice("input", msg, cfg["side_for"].to_int(0));
option_chosen = choice["value"];
text_input_result = choice["text"].str();
}
Expand Down

0 comments on commit 7418818

Please sign in to comment.