mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
Try fix bypassing destroyed fort drawbridge
This commit is contained in:
@ -1161,7 +1161,7 @@ ReachabilityInfo CBattleInfoCallback::makeBFS(const AccessibilityInfo &accessibi
|
|||||||
if(!params.startPosition.isValid()) //if got call for arrow turrets
|
if(!params.startPosition.isValid()) //if got call for arrow turrets
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
const std::set<BattleHex> quicksands = getStoppers(params.perspective);
|
const std::set<BattleHex> obstacles = getStoppers(params.perspective);
|
||||||
|
|
||||||
std::queue<BattleHex> hexq; //bfs queue
|
std::queue<BattleHex> hexq; //bfs queue
|
||||||
|
|
||||||
@ -1178,10 +1178,18 @@ ReachabilityInfo CBattleInfoCallback::makeBFS(const AccessibilityInfo &accessibi
|
|||||||
const BattleHex curHex = hexq.front();
|
const BattleHex curHex = hexq.front();
|
||||||
hexq.pop();
|
hexq.pop();
|
||||||
|
|
||||||
//walking stack can't step past the quicksands
|
//walking stack can't step past the obstacles
|
||||||
//TODO what if second hex of two-hex creature enters quicksand
|
//TODO what if second hex of two-hex creature enters obstacles
|
||||||
if(curHex != params.startPosition && vstd::contains(quicksands, curHex))
|
if(curHex != params.startPosition && vstd::contains(obstacles, curHex))
|
||||||
|
{
|
||||||
|
if(curHex == ESiegeHex::GATE_BRIDGE)
|
||||||
|
{
|
||||||
|
if(battleGetGateState() != EGateState::DESTROYED && params.side == BattleSide::ATTACKER)
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const int costToNeighbour = ret.distances[curHex.hex] + 1;
|
const int costToNeighbour = ret.distances[curHex.hex] + 1;
|
||||||
for(BattleHex neighbour : BattleHex::neighbouringTilesCache[curHex.hex])
|
for(BattleHex neighbour : BattleHex::neighbouringTilesCache[curHex.hex])
|
||||||
|
Reference in New Issue
Block a user