From c4fc8f08c0c7df7cb4d2413d70987802c780a978 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Sun, 21 Sep 2014 18:25:52 +0300 Subject: [PATCH] Moved assertions before variable is used --- lib/CGameState.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/CGameState.cpp b/lib/CGameState.cpp index 3a2f4a7d9..0f847fa55 100644 --- a/lib/CGameState.cpp +++ b/lib/CGameState.cpp @@ -3299,13 +3299,13 @@ void CPathfinder::initializeGraph() void CPathfinder::calculatePaths() { - int3 src = hero->getPosition(false); assert(hero); assert(hero == getHero(hero->id)); bool flying = hero->hasBonusOfType(Bonus::FLYING_MOVEMENT); int maxMovePointsLand = hero->maxMovePoints(true); int maxMovePointsWater = hero->maxMovePoints(false); + int3 src = hero->getPosition(false); auto maxMovePoints = [&](CGPathNode *cp) -> int { @@ -3323,7 +3323,6 @@ void CPathfinder::calculatePaths() initializeGraph(); - //initial tile - set cost on 0 and add to the queue CGPathNode &initialNode = *getNode(out.hpos); initialNode.turns = 0;