Skip to content

Commit

Permalink
SpellsLvl07: Check if target entity is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
bsxf-47 authored and Eli2 committed Jun 19, 2017
1 parent 641131c commit 55af0bb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/game/magic/spells/SpellsLvl07.cpp
Expand Up @@ -643,7 +643,12 @@ ConfuseSpell::ConfuseSpell()

void ConfuseSpell::Launch() {

ARX_SOUND_PlaySFX(SND_SPELL_CONFUSE, &entities[m_target]->pos);
Entity *target = entities.get(m_target);
if(!target) {
return;
}

ARX_SOUND_PlaySFX(SND_SPELL_CONFUSE, &target->pos);

m_hasDuration = true;
m_fManaCostPerSecond = 1.5f;
Expand Down

0 comments on commit 55af0bb

Please sign in to comment.