diff --git a/lib/JsonNode.cpp b/lib/JsonNode.cpp index 76ab8b9a6..4cdead98c 100644 --- a/lib/JsonNode.cpp +++ b/lib/JsonNode.cpp @@ -1156,7 +1156,7 @@ CSelector JsonUtils::parseSelector(const JsonNode & ability) { CSelector base = Selector::none; for(const auto & andN : value->Vector()) - base.Or(parseSelector(andN)); + base = base.Or(parseSelector(andN)); ret = ret.And(base); } @@ -1166,7 +1166,7 @@ CSelector JsonUtils::parseSelector(const JsonNode & ability) { CSelector base = Selector::none; for(const auto & andN : value->Vector()) - base.Or(parseSelector(andN)); + base = base.Or(parseSelector(andN)); ret = ret.And(base.Not()); } diff --git a/server/battles/BattleActionProcessor.cpp b/server/battles/BattleActionProcessor.cpp index 80242a49c..6fcf831b0 100644 --- a/server/battles/BattleActionProcessor.cpp +++ b/server/battles/BattleActionProcessor.cpp @@ -854,6 +854,8 @@ int BattleActionProcessor::moveStack(const CBattleInfoCallback & battle, int sta || start == battle::Unit::occupiedHex(dest, curStack->doubleWide(), curStack->unitSide())) passed.clear(); //Just empty passed, obstacles will handled automatically } + if(dest == start) //If dest is equal to start, then we should handle obstacles for it anyway + passed.clear(); //Just empty passed, obstacles will handled automatically //handling obstacle on the final field (separate, because it affects both flying and walking stacks) battle.handleObstacleTriggersForUnit(*gameHandler->spellEnv, *curStack, passed);