summaryrefslogtreecommitdiff
path: root/src/emap
diff options
context:
space:
mode:
Diffstat (limited to 'src/emap')
-rw-r--r--src/emap/battle.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/emap/battle.c b/src/emap/battle.c
index e8eed18..99dcf36 100644
--- a/src/emap/battle.c
+++ b/src/emap/battle.c
@@ -163,6 +163,10 @@ struct Damage ebattle_calc_magic_attack_post(struct Damage retVal,
uint16 skill_lv __attribute__ ((unused)),
int mflag __attribute__ ((unused)))
{
+ // Skip if things went wrong
+ if (src == NULL || target == NULL)
+ return retVal;
+
// Rebuild SD and SC data
struct map_session_data *sd, *tsd;
struct status_change *sc = status->get_sc(src);