From 750c53262bd2c2b8c2fd42d4f82e66490bebd778 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 29 Dec 2021 08:13:47 -0300 Subject: Add a fallback if source ends up messed up --- src/emap/script_buildins.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/emap') 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--; -- cgit v1.2.3-70-g09d2