fix test_wml_menu_items_1
by not checking can_use_synced_wml_menu() when using wesnoth.fire_wml_menu_item()
This commit is contained in:
parent
dbd9436c72
commit
a94228934a
2 changed files with 3 additions and 3 deletions
|
@ -175,8 +175,6 @@ const std::string & wml_menu_item::image() const
|
|||
*/
|
||||
bool wml_menu_item::can_show(const map_location & hex, const game_data & data, filter_context & filter_con) const
|
||||
{
|
||||
if(is_synced_ && !resources::controller->can_use_synced_wml_menu())
|
||||
return false;
|
||||
// Failing the [show_if] tag means no show.
|
||||
if ( !show_if_.empty() && !conditional_passed(show_if_) )
|
||||
return false;
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
#include "wmi_container.hpp"
|
||||
#include "handlers.hpp"
|
||||
#include "menu_item.hpp"
|
||||
#include "resources.hpp"
|
||||
#include "play_controller.hpp"
|
||||
|
||||
#include "../config.hpp"
|
||||
#include "../game_data.hpp"
|
||||
|
@ -121,7 +123,7 @@ std::vector<std::pair<boost::shared_ptr<const wml_menu_item>, std::string> > wmi
|
|||
BOOST_FOREACH( const item_ptr & item, std::make_pair (start, finish) )
|
||||
{
|
||||
// Can this item be shown?
|
||||
if ( item->use_wml_menu() && item->can_show(hex, gamedata, fc) )
|
||||
if ( item->use_wml_menu() && (!item->is_synced() || resources::controller->can_use_synced_wml_menu()) && item->can_show(hex, gamedata, fc) )
|
||||
{
|
||||
// Include this item.
|
||||
ret.push_back(std::make_pair(item, item->menu_text()));
|
||||
|
|
Loading…
Add table
Reference in a new issue