Browse Source

Seems to be actually a missing return and redundant check.

Michał W. Urbańczyk 13 years ago
parent
commit
247fabc3a6
2 changed files with 2 additions and 3 deletions
  1. 2 2
      lib/BattleState.cpp
  2. 0 1
      server/CGameHandler.cpp

+ 2 - 2
lib/BattleState.cpp

@@ -3063,8 +3063,8 @@ const CGHeroInstance * CStack::getMyHero() const
 		return dynamic_cast<const CGHeroInstance *>(base->armyObj);
 	else //we are attached directly?
 		BOOST_FOREACH(const CBonusSystemNode *n, getParentNodes())
-		if(n->getNodeType() == HERO)
-			dynamic_cast<const CGHeroInstance *>(n);//FIXME: unused result. Missing return?
+			if(n->getNodeType() == HERO)
+				return dynamic_cast<const CGHeroInstance *>(n);
 
 	return NULL;
 }

+ 0 - 1
server/CGameHandler.cpp

@@ -1517,7 +1517,6 @@ void CGameHandler::run(bool resume)
 		for(; i != gs->players.end(); i++)
 		{
 			if((i->second.towns.size()==0 && i->second.heroes.size()==0)
-				//|| i->second.color<0  //FIXME: color is unsigned. Redundant or incorrect check?
 				|| i->first>=GameConstants::PLAYER_LIMIT  
 				|| i->second.status) 
 			{