summaryrefslogtreecommitdiff
path: root/src/emap
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-12-29 08:13:47 -0300
committerJesusaves <cpntb1@ymail.com>2021-12-29 08:13:47 -0300
commit750c53262bd2c2b8c2fd42d4f82e66490bebd778 (patch)
tree15bfa7b44b1b4cbd397f48789b037b6c497ace0c /src/emap
parent9443a0d2124b05adc96aadc45a2c0de2f863bbec (diff)
downloadevol-hercules-750c53262bd2c2b8c2fd42d4f82e66490bebd778.tar.gz
evol-hercules-750c53262bd2c2b8c2fd42d4f82e66490bebd778.tar.bz2
evol-hercules-750c53262bd2c2b8c2fd42d4f82e66490bebd778.tar.xz
evol-hercules-750c53262bd2c2b8c2fd42d4f82e66490bebd778.zip
Add a fallback if source ends up messed up
Diffstat (limited to 'src/emap')
-rw-r--r--src/emap/script_buildins.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c
index 4ebab40..dd8666b 100644
--- a/src/emap/script_buildins.c
+++ b/src/emap/script_buildins.c
@@ -3451,6 +3451,12 @@ BUILDIN(harm)
return false;
}
+ // Nullity checks which a fallback exists
+ if (src == NULL) {
+ ShowWarning("buildin_harm: Invalid source!\n");
+ src = bl;
+ }
+
// Overflow checks
if( dmg == INT_MIN ) dmg++;
if( dmg == INT_MAX ) dmg--;