1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Code formatting

This commit is contained in:
Ivan Savenko 2022-11-16 12:29:07 +02:00
parent 48be492517
commit d1c95204c5
2 changed files with 5 additions and 5 deletions

View File

@ -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
}

View File

@ -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];