mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-14 02:33:51 +02:00
Moved assertions before variable is used
This commit is contained in:
parent
4bb5784922
commit
c4fc8f08c0
@ -3299,13 +3299,13 @@ void CPathfinder::initializeGraph()
|
|||||||
|
|
||||||
void CPathfinder::calculatePaths()
|
void CPathfinder::calculatePaths()
|
||||||
{
|
{
|
||||||
int3 src = hero->getPosition(false);
|
|
||||||
assert(hero);
|
assert(hero);
|
||||||
assert(hero == getHero(hero->id));
|
assert(hero == getHero(hero->id));
|
||||||
|
|
||||||
bool flying = hero->hasBonusOfType(Bonus::FLYING_MOVEMENT);
|
bool flying = hero->hasBonusOfType(Bonus::FLYING_MOVEMENT);
|
||||||
int maxMovePointsLand = hero->maxMovePoints(true);
|
int maxMovePointsLand = hero->maxMovePoints(true);
|
||||||
int maxMovePointsWater = hero->maxMovePoints(false);
|
int maxMovePointsWater = hero->maxMovePoints(false);
|
||||||
|
int3 src = hero->getPosition(false);
|
||||||
|
|
||||||
auto maxMovePoints = [&](CGPathNode *cp) -> int
|
auto maxMovePoints = [&](CGPathNode *cp) -> int
|
||||||
{
|
{
|
||||||
@ -3323,7 +3323,6 @@ void CPathfinder::calculatePaths()
|
|||||||
|
|
||||||
initializeGraph();
|
initializeGraph();
|
||||||
|
|
||||||
|
|
||||||
//initial tile - set cost on 0 and add to the queue
|
//initial tile - set cost on 0 and add to the queue
|
||||||
CGPathNode &initialNode = *getNode(out.hpos);
|
CGPathNode &initialNode = *getNode(out.hpos);
|
||||||
initialNode.turns = 0;
|
initialNode.turns = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user