Browse Source

fix button condition

Laserlicht 2 weeks ago
parent
commit
fc00774277

+ 0 - 6
client/adventureMap/AdventureMapShortcuts.cpp

@@ -665,12 +665,6 @@ bool AdventureMapShortcuts::optionMarketplace()
 	return false;
 }
 
-bool AdventureMapShortcuts::optionHeroGround()
-{
-	const CGHeroInstance *hero = GAME->interface()->localState->getCurrentHero();
-	return optionInMapView() && hero && !hero->inBoat();
-}
-
 bool AdventureMapShortcuts::optionHeroBoat(EPathfindingLayer layer)
 {
 	const CGHeroInstance *hero = GAME->interface()->localState->getCurrentHero();

+ 0 - 1
client/adventureMap/AdventureMapShortcuts.h

@@ -101,7 +101,6 @@ public:
 	bool optionMapScrollingActive();
 	bool optionMapViewActive();
 	bool optionMarketplace();
-	bool optionHeroGround();
 	bool optionHeroBoat(EPathfindingLayer layer);
 	bool optionHeroDig();
 

+ 1 - 1
client/adventureMap/AdventureMapWidget.cpp

@@ -427,7 +427,7 @@ void AdventureMapWidget::updateActiveStateChildren(CIntObject * widget)
 				container->setEnabled(shortcuts->optionHeroSleeping());
 
 			if (container->disableCondition == "heroGround")
-				container->setEnabled(shortcuts->optionHeroGround());
+				container->setEnabled(!shortcuts->optionHeroBoat(EPathfindingLayer::SAIL) && !shortcuts->optionHeroBoat(EPathfindingLayer::AIR));
 
 			if (container->disableCondition == "heroBoat")
 				container->setEnabled(shortcuts->optionHeroBoat(EPathfindingLayer::SAIL));