summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-08-07 15:00:59 -0300
committerJesusaves <cpntb1@ymail.com>2020-08-07 15:00:59 -0300
commit5ad77e97ee8079507d0bb8aa061cba2f013c1541 (patch)
treed9d680555d5d6323aa8831a3cf22fb2a2c0e1cef
parentadf6cb66bd706f1283ddc9512568aa432d7598bd (diff)
downloadevol-hercules-5ad77e97ee8079507d0bb8aa061cba2f013c1541.tar.gz
evol-hercules-5ad77e97ee8079507d0bb8aa061cba2f013c1541.tar.bz2
evol-hercules-5ad77e97ee8079507d0bb8aa061cba2f013c1541.tar.xz
evol-hercules-5ad77e97ee8079507d0bb8aa061cba2f013c1541.zip
Second degree of checking. I hate crashes.
-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);