Переглянути джерело

Merge pull request #2715 from IvanSavenko/regression_fix

Fix several recently discovered regressions
Ivan Savenko 2 роки тому
батько
коміт
adb633be30

+ 5 - 5
client/CPlayerInterface.cpp

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

+ 1 - 1
lib/mapObjects/IMarket.cpp

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

+ 6 - 0
server/battles/BattleFlowProcessor.cpp

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

+ 1 - 0
server/battles/BattleProcessor.h

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