summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorepoque11 <epoque11@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-04-26 19:19:31 +0000
committerepoque11 <epoque11@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-04-26 19:19:31 +0000
commit10fb201916b42c7502e6557a6fb0afb5a6ab059f (patch)
tree774420f3ea39b5ce2f32ace485ebc595ffd98a20 /src/map/script.c
parent273c5d25155c1b28cf26274fe32be3ed305bf188 (diff)
downloadhercules-10fb201916b42c7502e6557a6fb0afb5a6ab059f.tar.gz
hercules-10fb201916b42c7502e6557a6fb0afb5a6ab059f.tar.bz2
hercules-10fb201916b42c7502e6557a6fb0afb5a6ab059f.tar.xz
hercules-10fb201916b42c7502e6557a6fb0afb5a6ab059f.zip
- Follow-up to r15979, updated parse_simpleexpr to parse direction function invocation
- Added SCRIPT_CALLFUNC_CHECK macro to disable direct callback if affecting performance git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15981 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index e56c06db8..4ba2b4cbf 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -952,9 +952,12 @@ const char* parse_callfunc(const char* p, int require_paren)
if( *arg != '*' )
++arg; // count func as argument
} else {
+#ifdef SCRIPT_CALLFUNC_CHECK
const char* name = get_str(func);
if( strdb_get(userfunc_db, name) == NULL ) {
+#endif
disp_error_message("parse_line: expect command, missing function name or calling undeclared function",p);
+#ifdef SCRIPT_CALLFUNC_CHECK
} else {
int callfunc = search_str("callfunc");
add_scriptl(callfunc);
@@ -965,6 +968,7 @@ const char* parse_callfunc(const char* p, int require_paren)
arg = buildin_func[str_data[callfunc].val].arg;
if( *arg != '*' ) ++ arg;
}
+#endif
}
p = skip_word(p);
@@ -1104,6 +1108,14 @@ const char* parse_simpleexpr(const char *p)
l=add_word(p);
if( str_data[l].type == C_FUNC || str_data[l].type == C_USERFUNC || str_data[l].type == C_USERFUNC_POS)
return parse_callfunc(p,1);
+#ifdef SCRIPT_CALLFUNC_CHECK
+ else {
+ const char* name = get_str(l);
+ if( strdb_get(userfunc_db,name) != NULL ) {
+ return parse_callfunc(p,1);
+ }
+ }
+#endif
p=skip_word(p);
if( *p == '[' ){