summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-02-02 16:19:23 +0300
committerHaru <haru@dotalux.com>2019-02-04 23:12:27 +0100
commitc6246fb4b0d0d29d34082fe802b1cf2c8f970937 (patch)
treed3722564fca8dd182ad31fbc81f1b516c5f7ac2d
parent406ae363a78527fa1189cf29ab322e0a9146e330 (diff)
downloadhercules-c6246fb4b0d0d29d34082fe802b1cf2c8f970937.tar.gz
hercules-c6246fb4b0d0d29d34082fe802b1cf2c8f970937.tar.bz2
hercules-c6246fb4b0d0d29d34082fe802b1cf2c8f970937.tar.xz
hercules-c6246fb4b0d0d29d34082fe802b1cf2c8f970937.zip
Add missing check in run_script_main
Signed-off-by: Haru <haru@dotalux.com>
-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 25bf59839..ccd5eedcc 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 )