Skip to content

Commit

Permalink
Process WML menuitems only on key release (addresses #1711)
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Jun 11, 2017
1 parent 5d9cd6d commit 55e9305
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/hotkey/hotkey_handler.cpp
Expand Up @@ -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);
}
Expand Down

0 comments on commit 55e9305

Please sign in to comment.