Remove an unnecessary check.

wml_menu_item::can_show() already checks the last selected hex, so
no need for play_controller to worry about that check (which improves
data encapsulation -- now wml_menu_item::needs_select_ no longer needs
to be exposed to the general public).
This commit is contained in:
JaMiT 2013-10-27 02:42:15 -05:00
parent 6013a7293c
commit 01149e92eb
2 changed files with 2 additions and 8 deletions

View file

@ -45,8 +45,6 @@ public:
const std::string & event_name() const { return event_name_; }
/// The image associated with this menu item.
const std::string & image() const;
/// If true, then the preceeding "select" event needs to be stored in the replay.
bool needs_select() const { return needs_select_; }
/// Config object containing the default hotkey.
const config & default_hotkey() const { return default_hotkey_; }
/// If true, allow using a hotkey to trigger this item.

View file

@ -837,12 +837,8 @@ bool play_controller::execute_command(const hotkey::hotkey_command& cmd, int ind
if (iter->can_show(hex))
{
if((!iter->needs_select()
|| gamedata_.last_selected.valid()))
{
iter->fire_event(mouse_handler_.get_last_hex(),
gamedata_.last_selected);
}
iter->fire_event(mouse_handler_.get_last_hex(),
gamedata_.last_selected);
}
}
}