diff options
-rw-r--r-- | Changelog-Trunk.txt | 2 | ||||
-rw-r--r-- | src/map/script.c | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 97d3721df..5aac4a093 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/09/25
+ * Merged FlavioJS's script patch which should fix stuff like "mes ();"
+ causing crashes. [Skotlex]
* Item group reading will now complain when a line doesn't has enough
fields. [Skotlex]
* Fixed #baselevelup adding instead of substracting status points when used
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; |