Browse Source

Moved assertions before variable is used

Ivan Savenko 11 years ago
parent
commit
c4fc8f08c0
1 changed files with 1 additions and 2 deletions
  1. 1 2
      lib/CGameState.cpp

+ 1 - 2
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;