diff --git a/spell.c b/spell.c index e9fff26..ba62078 100644 --- a/spell.c +++ b/spell.c @@ -4176,11 +4176,11 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ 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 // see. loft = getspellloftype(spellid); - if (loft != LOF_DONTNEED) { + if (targcell && (loft != LOF_DONTNEED)) { cell_t *newtarg; haslof(caster->cell, targcell, loft, &newtarg); targcell = newtarg;