summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-02-04 23:09:03 +0100
committerGitHub <noreply@github.com>2019-02-04 23:09:03 +0100
commit23c4071640d98c3029a7ae8dd7debef2ddcd0814 (patch)
treeb90407312fb789bb329b85d8e05d19b2de4b4a6e
parent5182ecdd2649f43644a2e8767ad8f016e62bd8f7 (diff)
parentc7980f7b24c4037fc5d43b0e3cadbcc3a678ca86 (diff)
downloadhercules-23c4071640d98c3029a7ae8dd7debef2ddcd0814.tar.gz
hercules-23c4071640d98c3029a7ae8dd7debef2ddcd0814.tar.bz2
hercules-23c4071640d98c3029a7ae8dd7debef2ddcd0814.tar.xz
hercules-23c4071640d98c3029a7ae8dd7debef2ddcd0814.zip
Merge pull request #2362 from 4144/addchecks
Add missing check in run_script_main
-rw-r--r--src/map/script.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 14623bac7..be591a3ae 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -4621,6 +4621,9 @@ static void run_script_main(struct script_state *st)
nullpo_retv(st);
script->attach_state(st);
+ if (st->state != END && Assert_chk(st->state == RUN || st->state == STOP || st->state == RERUNLINE)) {
+ st->state = END;
+ }
nd = map->id2nd(st->oid);
if( nd && nd->bl.m >= 0 )