From 0bdd239ebf26779ee70ffca7f50d0a9c7b01d2c7 Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 25 Sep 2006 20:47:07 +0000 Subject: - 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 --- src/map/script.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3-70-g09d2