From 55e93059d246902f5db353a8d4346926f295d94c Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 11 Jun 2017 18:11:15 -0400 Subject: [PATCH] Process WML menuitems only on key release (addresses #1711) --- src/hotkey/hotkey_handler.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/hotkey/hotkey_handler.cpp b/src/hotkey/hotkey_handler.cpp index cf566f7eefa1..f315471888bd 100644 --- a/src/hotkey/hotkey_handler.cpp +++ b/src/hotkey/hotkey_handler.cpp @@ -253,13 +253,12 @@ bool play_controller::hotkey_handler::execute_command(const hotkey::hotkey_comma } } int prefixlen = wml_menu_hotkey_prefix.length(); - if(command == hotkey::HOTKEY_WML && cmd.command.compare(0, prefixlen, wml_menu_hotkey_prefix) == 0) + if(press && command == hotkey::HOTKEY_WML && cmd.command.compare(0, prefixlen, wml_menu_hotkey_prefix) == 0) { std::string name = cmd.command.substr(prefixlen); const map_location& hex = mouse_handler_.get_last_hex(); - gamestate().get_wml_menu_items().fire_item(name, hex, gamestate().gamedata_, gamestate(), gamestate().board_.units_); - /// @todo Shouldn't the function return at this point? + return gamestate().get_wml_menu_items().fire_item(name, hex, gamestate().gamedata_, gamestate(), gamestate().board_.units_); } return command_executor::execute_command(cmd, index, press); }