Pārlūkot izejas kodu

Code formatting

Ivan Savenko 3 gadi atpakaļ
vecāks
revīzija
d1c95204c5

+ 3 - 3
client/battle/CBattleAnimations.cpp

@@ -841,10 +841,10 @@ bool CShootingAnimation::init()
 	double pi = boost::math::constants::pi<double>();
 
 	//in some cases (known one: hero grants shooter bonus to unit) the shooter stack's projectile may not be properly initialized
-	if (owner->idToProjectile.count(spi.creID) == 0 && owner->idToRay.count(spi.creID) == 0)
+	if (!owner->idToProjectile.count(spi.creID) && !owner->idToRay.count(spi.creID))
 		owner->initStackProjectile(shooter);
 
-	if (owner->idToProjectile.count(spi.creID) != 0)
+	if (owner->idToProjectile.count(spi.creID))
 	{
 		// only frames below maxFrame are usable: anything  higher is either no present or we don't know when it should be used
 		size_t maxFrame = std::min<size_t>(angles.size(), owner->idToProjectile.at(spi.creID)->size(0));
@@ -868,7 +868,7 @@ bool CShootingAnimation::init()
 
 		spi.frameNum = static_cast<int>(bestID);
 	}
-	else if (owner->idToRay.count(spi.creID) != 0)
+	else if (owner->idToRay.count(spi.creID))
 	{
 		// no-op
 	}

+ 2 - 2
client/battle/CBattleInterface.cpp

@@ -3213,7 +3213,7 @@ void CBattleInterface::showProjectiles(SDL_Surface *to)
 				continue; // wait...
 		}
 
-		if ( idToProjectile.count(it->creID) != 0)
+		if (idToProjectile.count(it->creID))
 		{
 			size_t group = it->reverse ? 1 : 0;
 			auto image = idToProjectile[it->creID]->getImage(it->frameNum, group, true);
@@ -3229,7 +3229,7 @@ void CBattleInterface::showProjectiles(SDL_Surface *to)
 				image->draw(to, &dst, nullptr);
 			}
 		}
-		if (idToRay.count(it->creID) != 0)
+		if (idToRay.count(it->creID))
 		{
 			auto const & ray = idToRay[it->creID];