diff options
author | mekolat <mekolat@users.noreply.github.com> | 2015-04-26 09:59:54 -0400 |
---|---|---|
committer | mekolat <mekolat@users.noreply.github.com> | 2015-05-05 10:18:27 -0400 |
commit | 307c60a8faf7d1e7cb98c9d89a7a737a0267d37a (patch) | |
tree | 2e702aaf6f7fc41eed41dc2becc0898519d4f2bf /src | |
parent | 032ae6a08cdba3a162a52d480fd32df3bf68ec98 (diff) | |
download | tmwa-307c60a8faf7d1e7cb98c9d89a7a737a0267d37a.tar.gz tmwa-307c60a8faf7d1e7cb98c9d89a7a737a0267d37a.tar.bz2 tmwa-307c60a8faf7d1e7cb98c9d89a7a737a0267d37a.tar.xz tmwa-307c60a8faf7d1e7cb98c9d89a7a737a0267d37a.zip |
make the script-fun die on errors
Diffstat (limited to 'src')
-rw-r--r-- | src/map/script-fun.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 142debf..fe46685 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -108,8 +108,9 @@ void builtin_goto(ScriptState *st) { if (!AARG(0).is<ScriptDataPos>()) { - PRINTF("script: goto: that's not a label!\n"_fmt); + PRINTF("fatal: script: goto: not label !\n"_fmt); st->state = ScriptEndState::END; + runflag = 0; return; } @@ -149,8 +150,9 @@ void builtin_callfunc(ScriptState *st) } OMATCH_CASE_NONE () { - PRINTF("script: callfunc: function not found! [%s]\n"_fmt, str); + PRINTF("fatal: script: callfunc: function not found! [%s]\n"_fmt, str); st->state = ScriptEndState::END; + runflag = 0; } } OMATCH_END (); @@ -276,7 +278,9 @@ void builtin_menu(ScriptState *st) int arg_index = (sd->npc_menu - 1) * 2 + 1; if (!AARG(arg_index).is<ScriptDataPos>()) { + PRINTF("fatal: script:menu: not a label\n"_fmt); st->state = ScriptEndState::END; + runflag = 0; return; } st->scriptp.pos = AARG(arg_index).get_if<ScriptDataPos>()->numi; |