From 09a8152cd357b9a4bfbea4a265d99d2caabbe295 Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Tue, 31 May 2016 01:00:35 +1000 Subject: [PATCH] Fix crash when casting telekinesis. --- spell.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;