mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-01 23:12:49 +02:00
CGPathNode: get rid of land member as it's now obsolete
CTerrainRect::showPath behaviour changed so it's will only add cross path graphics on embark/disembark and path ending. We want continuous paths for flying and water walking even when land<-> water transition occur.
This commit is contained in:
@@ -63,7 +63,7 @@ void CPathfinder::calculatePaths()
|
||||
|
||||
auto maxMovePoints = [&](CGPathNode *cp) -> int
|
||||
{
|
||||
return cp->land ? maxMovePointsLand : maxMovePointsWater;
|
||||
return cp->layer == EPathfindingLayer::SAIL ? maxMovePointsWater : maxMovePointsLand;
|
||||
};
|
||||
|
||||
auto isBetterWay = [&](int remains, int turn) -> bool
|
||||
@@ -181,7 +181,7 @@ void CPathfinder::addNeighbours(const int3 &coord)
|
||||
ct = &gs->map->getTile(coord);
|
||||
|
||||
std::vector<int3> tiles;
|
||||
gs->getNeighbours(*ct, coord, tiles, boost::logic::indeterminate, !cp->land);
|
||||
gs->getNeighbours(*ct, coord, tiles, boost::logic::indeterminate, cp->layer == EPathfindingLayer::SAIL); // TODO: find out if we still need "limitCoastSailing" option
|
||||
sTileObj = ct->topVisitableObj(coord == out.hpos);
|
||||
if(canVisitObject())
|
||||
{
|
||||
@@ -411,7 +411,7 @@ bool CPathfinder::isSourceGuarded()
|
||||
{
|
||||
//special case -> hero embarked a boat standing on a guarded tile -> we must allow to move away from that tile
|
||||
if(cp->accessible != CGPathNode::VISITABLE
|
||||
|| !cp->theNodeBefore->land
|
||||
|| !cp->theNodeBefore->layer != EPathfindingLayer::LAND
|
||||
|| ct->topVisitableId() != Obj::BOAT)
|
||||
{
|
||||
return true;
|
||||
@@ -444,7 +444,6 @@ void CPathfinder::initializeGraph()
|
||||
auto node = out.getNode(pos, layer);
|
||||
node->reset();
|
||||
node->accessible = evaluateAccessibility(pos, tinfo);
|
||||
node->land = tinfo->terType != ETerrainType::WATER;
|
||||
};
|
||||
|
||||
int3 pos;
|
||||
@@ -572,7 +571,6 @@ void CGPathNode::reset()
|
||||
{
|
||||
locked = false;
|
||||
accessible = NOT_SET;
|
||||
land = 0;
|
||||
moveRemains = 0;
|
||||
turns = 255;
|
||||
theNodeBefore = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user