Fix crash when casting telekinesis.

This commit is contained in:
Rob Pearce 2016-05-31 01:00:35 +10:00
parent 7fa750baef
commit 09a8152cd3
1 changed files with 2 additions and 2 deletions

View File

@ -4176,11 +4176,11 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
targcell = retcell[maxr]; targcell = retcell[maxr];
} }
// adjust for LOF (we already validated this during castspell()'s call to validatespellcell(), // adjust for LOF - we already validated this during castspell()'s call to validatespellcell(),
// but check again in case, for example, there was an invisible lf in the way which we couldn't // but check again in case, for example, there was an invisible lf in the way which we couldn't
// see. // see.
loft = getspellloftype(spellid); loft = getspellloftype(spellid);
if (loft != LOF_DONTNEED) { if (targcell && (loft != LOF_DONTNEED)) {
cell_t *newtarg; cell_t *newtarg;
haslof(caster->cell, targcell, loft, &newtarg); haslof(caster->cell, targcell, loft, &newtarg);
targcell = newtarg; targcell = newtarg;