summaryrefslogtreecommitdiff
path: root/src/emap/battle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emap/battle.c')
-rw-r--r--src/emap/battle.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/emap/battle.c b/src/emap/battle.c
index abc38a5..e8eed18 100644
--- a/src/emap/battle.c
+++ b/src/emap/battle.c
@@ -173,7 +173,11 @@ struct Damage ebattle_calc_magic_attack_post(struct Damage retVal,
sd = BL_CAST(BL_PC, src);
tsd = BL_CAST(BL_PC, target);
- //Skip checking as there are no status changes active.
+ // Skip if things went wrong
+ if (sd == NULL || tsd == NULL)
+ return retVal;
+
+ // Skip checking as there are no status changes active.
if (sc && !sc->count)
sc = NULL;
if (tsc && !tsc->count)