summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-25 20:47:07 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-25 20:47:07 +0000
commit0bdd239ebf26779ee70ffca7f50d0a9c7b01d2c7 (patch)
tree3158d84376d974aff5eeec37d4d16b0e88d56f1e /src/map/script.c
parent1129f1a4fbf910016ff6b3b44b3cd178237ee95d (diff)
downloadhercules-0bdd239ebf26779ee70ffca7f50d0a9c7b01d2c7.tar.gz
hercules-0bdd239ebf26779ee70ffca7f50d0a9c7b01d2c7.tar.bz2
hercules-0bdd239ebf26779ee70ffca7f50d0a9c7b01d2c7.tar.xz
hercules-0bdd239ebf26779ee70ffca7f50d0a9c7b01d2c7.zip
- Merged FlavioJS's script patch which should fix stuff like "mes ();" causing crashes.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8867 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c
index d8bbe4aa2..263e319c1 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -671,7 +671,9 @@ unsigned char* parse_subexpr(unsigned char *p,int limit)
exit(0);
}
func=parse_cmd;
-
+ if( *p == '(' && *(plist[i]=(char *)skip_space(p+1)) == ')' ){
+ p=(char *)plist[i]+1; // empty argument list
+ } else
while(*p && *p!=')' && i<128) {
plist[i]=(char *) p;
p=parse_subexpr(p,-1);
@@ -726,12 +728,14 @@ unsigned char* parse_expr(unsigned char *p)
disp_error_message("unexpected char",p);
exit(1);
}
+ /*
if(*p == '(') {
unsigned char *p2 = skip_space(p + 1);
if(*p2 == ')') {
return p2 + 1;
}
}
+ */
p=parse_subexpr(p,-1);
#ifdef DEBUG_FUNCIN
if(battle_config.etc_log)
@@ -800,6 +804,10 @@ unsigned char* parse_line(unsigned char *p)
} else {
end = ';';
}
+
+ if( p && *p == '(' && *(p2=(char *)skip_space(p+1)) == ')' ){
+ p= p2+1; // empty argument list
+ } else
while(p && *p && *p != end && i<128){
plist[i]=(char *) p;