1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Fix cast animation for Genie and heroes

This commit is contained in:
Ivan Savenko
2022-12-14 14:48:02 +02:00
parent 7857668158
commit 3693184e51
2 changed files with 9 additions and 3 deletions

View File

@@ -492,7 +492,11 @@ void BattleInterface::spellCast(const BattleSpellCast * sc)
if (!castSoundPath.empty())
{
executeOnAnimationCondition(EAnimationEvents::BEFORE_HIT, true, [=]() {
auto group = spell->animationInfo.projectile.empty() ?
EAnimationEvents::HIT:
EAnimationEvents::BEFORE_HIT;//FIXME: should be on projectile spawning
executeOnAnimationCondition(group, true, [=]() {
CCS->soundh->playSound(castSoundPath);
});
}
@@ -510,7 +514,6 @@ void BattleInterface::spellCast(const BattleSpellCast * sc)
});
}
else
if (targetedTile.isValid())
{
auto hero = sc->side ? defendingHero : attackingHero;
assert(hero);