For a [message] with options, zero-initialise the default selection int (#6217)

I can't reproduce the issue (it selects the first option by default for me even
without this), but this probably fixes #6038 "When you have a long list of
[message][option], it will default to highlighting the 3rd entry for some
reason."
This commit is contained in:
Steve Cotton 2021-10-23 18:17:31 +02:00 committed by GitHub
parent 7f2323ddc5
commit 219f2c8f02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,7 +77,7 @@ int show_message_dialog(lua_State* L)
input.maximum_length = txt_cfg["max_length"].to_int(256);
input.text_input_was_specified = has_input;
gui2::dialogs::wml_message_options options;
auto options = gui2::dialogs::wml_message_options {};
if(!lua_isnoneornil(L, 2)) {
luaL_checktype(L, 2, LUA_TTABLE);
std::size_t n = lua_rawlen(L, 2);