1
0
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:
Ivan Savenko 2023-08-31 15:41:04 +03:00 committed by GitHub
commit adb633be30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 6 deletions

View File

@ -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--)

View File

@ -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);

View File

@ -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);

View File

@ -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);