mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-31 22:05:10 +02:00
commit
aa2934853f
@ -91,12 +91,12 @@ namespace AIPathfinding
|
|||||||
|
|
||||||
for(const CGHeroInstance * hero : nodeStorage->getAllHeroes())
|
for(const CGHeroInstance * hero : nodeStorage->getAllHeroes())
|
||||||
{
|
{
|
||||||
if(hero->canCastThisSpell(waterWalk.toSpell()))
|
if(hero->canCastThisSpell(waterWalk.toSpell()) && hero->mana >= hero->getSpellCost(waterWalk.toSpell()))
|
||||||
{
|
{
|
||||||
waterWalkingActions[hero] = std::make_shared<WaterWalkingAction>(hero);
|
waterWalkingActions[hero] = std::make_shared<WaterWalkingAction>(hero);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hero->canCastThisSpell(airWalk.toSpell()))
|
if(hero->canCastThisSpell(airWalk.toSpell()) && hero->mana >= hero->getSpellCost(airWalk.toSpell()))
|
||||||
{
|
{
|
||||||
airWalkingActions[hero] = std::make_shared<AirWalkingAction>(hero);
|
airWalkingActions[hero] = std::make_shared<AirWalkingAction>(hero);
|
||||||
}
|
}
|
||||||
@ -179,11 +179,6 @@ namespace AIPathfinding
|
|||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
if(!specialAction->canAct(nodeStorage->getAINode(source.node)))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
nodeStorage->updateAINode(destination.node, [&](AIPathNode * node)
|
nodeStorage->updateAINode(destination.node, [&](AIPathNode * node)
|
||||||
{
|
{
|
||||||
auto castNodeOptional = nodeStorage->getOrCreateNode(
|
auto castNodeOptional = nodeStorage->getOrCreateNode(
|
||||||
|
@ -441,7 +441,12 @@ void AdventureMapInterface::onPlayerTurnStarted(PlayerColor playerID)
|
|||||||
if(auto iw = GH.windows().topWindow<CInfoWindow>())
|
if(auto iw = GH.windows().topWindow<CInfoWindow>())
|
||||||
iw->close();
|
iw->close();
|
||||||
|
|
||||||
hotkeyEndingTurn();
|
boost::thread newThread([this]()
|
||||||
|
{
|
||||||
|
hotkeyEndingTurn();
|
||||||
|
});
|
||||||
|
|
||||||
|
newThread.detach();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user