mirror of
https://github.com/vcmi/vcmi.git
synced 2026-06-19 22:57:37 +02:00
Code formatting
This commit is contained in:
@@ -841,10 +841,10 @@ bool CShootingAnimation::init()
|
|||||||
double pi = boost::math::constants::pi<double>();
|
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
|
//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);
|
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
|
// 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));
|
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);
|
spi.frameNum = static_cast<int>(bestID);
|
||||||
}
|
}
|
||||||
else if (owner->idToRay.count(spi.creID) != 0)
|
else if (owner->idToRay.count(spi.creID))
|
||||||
{
|
{
|
||||||
// no-op
|
// no-op
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3213,7 +3213,7 @@ void CBattleInterface::showProjectiles(SDL_Surface *to)
|
|||||||
continue; // wait...
|
continue; // wait...
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( idToProjectile.count(it->creID) != 0)
|
if (idToProjectile.count(it->creID))
|
||||||
{
|
{
|
||||||
size_t group = it->reverse ? 1 : 0;
|
size_t group = it->reverse ? 1 : 0;
|
||||||
auto image = idToProjectile[it->creID]->getImage(it->frameNum, group, true);
|
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);
|
image->draw(to, &dst, nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (idToRay.count(it->creID) != 0)
|
if (idToRay.count(it->creID))
|
||||||
{
|
{
|
||||||
auto const & ray = idToRay[it->creID];
|
auto const & ray = idToRay[it->creID];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user