mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Merge pull request #2715 from IvanSavenko/regression_fix
Fix several recently discovered regressions
This commit is contained in:
commit
adb633be30
@ -2025,13 +2025,13 @@ void CPlayerInterface::doMoveHero(const CGHeroInstance * h, CGPath path)
|
||||
|
||||
auto canStop = [&](CGPathNode * node) -> bool
|
||||
{
|
||||
if (node->layer == EPathfindingLayer::LAND || node->layer == EPathfindingLayer::SAIL)
|
||||
return true;
|
||||
if (node->layer != EPathfindingLayer::LAND && node->layer != EPathfindingLayer::SAIL)
|
||||
return false;
|
||||
|
||||
if (node->accessible == EPathAccessibility::ACCESSIBLE)
|
||||
return true;
|
||||
if (node->accessible != EPathAccessibility::ACCESSIBLE)
|
||||
return false;
|
||||
|
||||
return false;
|
||||
return true;
|
||||
};
|
||||
|
||||
for (i=(int)path.nodes.size()-1; i>0 && (stillMoveHero.data == CONTINUE_MOVE || !canStop(&path.nodes[i])); i--)
|
||||
|
@ -169,7 +169,7 @@ IMarket::IMarket()
|
||||
std::vector<EMarketMode> IMarket::availableModes() const
|
||||
{
|
||||
std::vector<EMarketMode> ret;
|
||||
for (EMarketMode i = static_cast<EMarketMode>(0); i < EMarketMode::MARTKET_AFTER_LAST_PLACEHOLDER; vstd::next(i, 1))
|
||||
for (EMarketMode i = static_cast<EMarketMode>(0); i < EMarketMode::MARTKET_AFTER_LAST_PLACEHOLDER; i = vstd::next(i, 1))
|
||||
if(allowsTrade(i))
|
||||
ret.push_back(i);
|
||||
|
||||
|
@ -507,6 +507,12 @@ void BattleFlowProcessor::onActionMade(const BattleAction &ba)
|
||||
{
|
||||
const auto & battle = gameHandler->gameState()->curB;
|
||||
|
||||
if (ba.actionType == EActionType::END_TACTIC_PHASE)
|
||||
{
|
||||
onTacticsEnded();
|
||||
return;
|
||||
}
|
||||
|
||||
const CStack * actedStack = battle->battleGetStackByID(ba.stackNumber, false);
|
||||
const CStack * activeStack = battle->battleGetStackByID(battle->getActiveStackID(), false);
|
||||
|
||||
|
@ -39,6 +39,7 @@ class BattleProcessor : boost::noncopyable
|
||||
std::unique_ptr<BattleFlowProcessor> flowProcessor;
|
||||
std::unique_ptr<BattleResultProcessor> resultProcessor;
|
||||
|
||||
void onTacticsEnded();
|
||||
void updateGateState();
|
||||
void engageIntoBattle(PlayerColor player);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user