[-] Fixed spell sound distance calculation

This commit is contained in:
cybermind 2014-06-12 15:21:14 +06:00
parent 8c5ec2dae0
commit b8a682ac25

View file

@ -533,7 +533,7 @@ int SpellCast(CUnit &caster, const SpellType &spell, CUnit *target, const Vec2i
if (spell.Target == TargetSelf) {
PlayUnitSound(caster, spell.SoundWhenCast.Sound);
} else {
PlayGameSound(spell.SoundWhenCast.Sound, CalculateVolume(false, ViewPointDistance(goalPos), spell.SoundWhenCast.Sound->Range));
PlayGameSound(spell.SoundWhenCast.Sound, CalculateVolume(false, ViewPointDistance(target ? target->tilePos : goalPos), spell.SoundWhenCast.Sound->Range));
}
}
for (std::vector<SpellActionType *>::const_iterator act = spell.Action.begin();