|
@@ -756,7 +756,15 @@ void ShootingAnimation::createProjectile(const Point & from, const Point & dest)
|
|
|
uint32_t ShootingAnimation::getAttackClimaxFrame() const
|
|
|
{
|
|
|
const CCreature *shooterInfo = getCreature();
|
|
|
- return shooterInfo->animation.attackClimaxFrame;
|
|
|
+
|
|
|
+ uint32_t maxFrames = stackAnimation(attackingStack)->framesInGroup(getGroup());
|
|
|
+ uint32_t climaxFrame = shooterInfo->animation.attackClimaxFrame;
|
|
|
+ uint32_t selectedFrame = vstd::clamp(shooterInfo->animation.attackClimaxFrame, 1, maxFrames);
|
|
|
+
|
|
|
+ if (climaxFrame != selectedFrame)
|
|
|
+ logGlobal->warn("Shooter %s has ranged attack climax frame set to %d, but only %d available!", shooterInfo->getNamePluralTranslated(), climaxFrame, maxFrames);
|
|
|
+
|
|
|
+ return selectedFrame - 1; // H3 counts frames from 1
|
|
|
}
|
|
|
|
|
|
ECreatureAnimType ShootingAnimation::getUpwardsGroup() const
|