[-] Fixed crash when autocasting spells without sound
This commit is contained in:
parent
1bfbd56f92
commit
12e52ab172
1 changed files with 6 additions and 4 deletions
|
@ -529,10 +529,12 @@ int SpellCast(CUnit &caster, const SpellType &spell, CUnit *target, const Vec2i
|
|||
//
|
||||
// Ugly hack, CastAdjustVitals makes it's own mana calculation.
|
||||
//
|
||||
if (spell.Target == TargetSelf) {
|
||||
PlayUnitSound(caster, spell.SoundWhenCast.Sound);
|
||||
} else {
|
||||
PlayGameSound(spell.SoundWhenCast.Sound, CalculateVolume(false, ViewPointDistance(goalPos), spell.SoundWhenCast.Sound->Range));
|
||||
if (spell.SoundWhenCast.Sound) {
|
||||
if (spell.Target == TargetSelf) {
|
||||
PlayUnitSound(caster, spell.SoundWhenCast.Sound);
|
||||
} else {
|
||||
PlayGameSound(spell.SoundWhenCast.Sound, CalculateVolume(false, ViewPointDistance(goalPos), spell.SoundWhenCast.Sound->Range));
|
||||
}
|
||||
}
|
||||
for (std::vector<SpellActionType *>::const_iterator act = spell.Action.begin();
|
||||
act != spell.Action.end(); ++act) {
|
||||
|
|
Loading…
Reference in a new issue