summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c
index cfc7ed052..cc9552d60 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -14620,8 +14620,20 @@ BUILDIN(setbattleflag)
BUILDIN(getbattleflag)
{
const char *flag;
+ int value;
+
flag = script_getstr(st,2);
- script_pushint(st,battle->config_get_value(flag));
+
+ if (battle->config_get_value(flag, &value)) {
+ script_pushint(st,value);
+ return true;
+ } else {
+ script_pushint(st,0);
+ ShowWarning("buildin_getbattleflag: non-exist battle config requested %s \n", flag);
+ script->reportsrc(st);
+ return false;
+ }
+
return true;
}