summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorYour Name <hemagx2@gmail.com>2015-12-12 21:44:27 +0200
committerHaru <haru@dotalux.com>2015-12-13 03:55:41 +0100
commitf102c913b2aa093ef40c7846e25850ebb1106d71 (patch)
tree8965bde6164baa50121171c7291ea438e11d8503 /src/map/script.c
parentbb214d4651c9c9aa9599f50cb5de52059176a87f (diff)
downloadhercules-f102c913b2aa093ef40c7846e25850ebb1106d71.tar.gz
hercules-f102c913b2aa093ef40c7846e25850ebb1106d71.tar.bz2
hercules-f102c913b2aa093ef40c7846e25850ebb1106d71.tar.xz
hercules-f102c913b2aa093ef40c7846e25850ebb1106d71.zip
- Fixed #723 now it's possible to retrieve Battle Config Settings from plugins into scripts
- Fixed Possible Crash when null parse function pointer passed to HPMi->addConf - Now it's possible to use same parse function for all config entries - Now Battle Config entries must have a return function
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;
}