Browse Source

Some assertions in hope to get clearer reason for #955/#1076.

Michał W. Urbańczyk 13 years ago
parent
commit
40624f96d9
1 changed files with 2 additions and 0 deletions
  1. 2 0
      AI/StupidAI/StupidAI.cpp

+ 2 - 0
AI/StupidAI/StupidAI.cpp

@@ -156,7 +156,9 @@ BattleAction CStupidAI::activeStack( const CStack * stack )
 	}
 	}
 	else
 	else
 	{
 	{
+		assert(enemiesUnreachable.size());
 		const EnemyInfo &ei= *std::min_element(enemiesUnreachable.begin(), enemiesUnreachable.end(), boost::bind(isCloser, _1, _2, boost::ref(dists)));
 		const EnemyInfo &ei= *std::min_element(enemiesUnreachable.begin(), enemiesUnreachable.end(), boost::bind(isCloser, _1, _2, boost::ref(dists)));
+		assert(ei.s);
 		if(distToNearestNeighbour(ei.s->position, dists) < GameConstants::BFIELD_SIZE)
 		if(distToNearestNeighbour(ei.s->position, dists) < GameConstants::BFIELD_SIZE)
 		{
 		{
 			return goTowards(stack, ei.s->position);
 			return goTowards(stack, ei.s->position);