diff options
author | mekolat <mekolat@users.noreply.github.com> | 2015-05-20 13:22:05 -0400 |
---|---|---|
committer | mekolat <mekolat@users.noreply.github.com> | 2015-05-20 13:22:05 -0400 |
commit | ab836451986e596d66df6aadd6af7a955ae8ff4e (patch) | |
tree | 7db3afc5f050564d9dcbdbac25d18563a879f666 /src/map/script-call.cpp | |
parent | c0ada60ff51a7166f782a88e56e7a880e4e34650 (diff) | |
download | tmwa-ab836451986e596d66df6aadd6af7a955ae8ff4e.tar.gz tmwa-ab836451986e596d66df6aadd6af7a955ae8ff4e.tar.bz2 tmwa-ab836451986e596d66df6aadd6af7a955ae8ff4e.tar.xz tmwa-ab836451986e596d66df6aadd6af7a955ae8ff4e.zip |
use abort instead of runflag on errors
Diffstat (limited to 'src/map/script-call.cpp')
-rw-r--r-- | src/map/script-call.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/map/script-call.cpp b/src/map/script-call.cpp index 1514ec2..83b6f24 100644 --- a/src/map/script-call.cpp +++ b/src/map/script-call.cpp @@ -586,8 +586,7 @@ void run_func(ScriptState *st) if (battle_config.error_log) PRINTF("function not found\n"_fmt); st->state = ScriptEndState::END; - runflag = 0; - return; + abort(); } } // the func is before the arg @@ -599,8 +598,7 @@ void run_func(ScriptState *st) { PRINTF("run_func: not function and command! \n"_fmt); st->state = ScriptEndState::END; - runflag = 0; - return; + abort(); } size_t func = st->stack->stack_datav[st->start].get_if<ScriptDataFuncRef>()->numi; @@ -669,8 +667,7 @@ void run_func(ScriptState *st) { PRINTF("script:run_func (return) return without callfunc or callsub!\n"_fmt); st->state = ScriptEndState::END; - runflag = 0; - return; + abort(); } assert (olddefsp == st->defsp); // pretty sure it hasn't changed yet st->scriptp.code = Some(conv_script(st, &st->stack->stack_datav[olddefsp - 1])); // スクリプトを復元 @@ -766,7 +763,7 @@ void run_script_main(ScriptState *st, Borrowed<const ScriptBuffer> rootscript) { PRINTF("run_script: infinity loop !\n"_fmt); st->state = ScriptEndState::END; - runflag = 0; + abort(); } } break; @@ -828,7 +825,7 @@ void run_script_main(ScriptState *st, Borrowed<const ScriptBuffer> rootscript) { PRINTF("run_script: infinity loop !\n"_fmt); st->state = ScriptEndState::END; - runflag = 0; + abort(); } } switch (st->state) |