summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-23 07:09:24 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-23 07:09:24 +0000
commite2ab16bcfa3a6e06c30ad76b7e14bf8570a37a2c (patch)
tree0da80c063e7e6a26ac79f45c7d2504fe7cd20866
parent1fa3b3d27b2dc44b41516526314162f7e679a5c1 (diff)
downloadhercules-e2ab16bcfa3a6e06c30ad76b7e14bf8570a37a2c.tar.gz
hercules-e2ab16bcfa3a6e06c30ad76b7e14bf8570a37a2c.tar.bz2
hercules-e2ab16bcfa3a6e06c30ad76b7e14bf8570a37a2c.tar.xz
hercules-e2ab16bcfa3a6e06c30ad76b7e14bf8570a37a2c.zip
- Fallback for parenthesis argument lists in the script engine. "func (exp) , ..." is valid again.
Why didn't I think of this earlier? /hmm git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9565 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/map/script.c13
2 files changed, 13 insertions, 2 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 726c974dd..2b679299e 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/12/23
+ * Fallback for parenthesis argument lists in the script engine.
+ "func (exp) , ..." is valid again.
* Moved "#include <limits.h>" to cbasetypes.h to ensure it's included
before checking if UINT_MAX has been defined.
* Minor changes in pc_readdb related to max_level being unsigned.
diff --git a/src/map/script.c b/src/map/script.c
index 48ac823d8..b9aa5e3ad 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -853,8 +853,17 @@ const char* parse_line(const char* p)
p=parse_expr(p);
p=skip_space(p);
// 引数区切りの,処理
- if(*p==',') {
- if(arg == NULL || arg[j] == '*' || i+1 < j)
+ if( *p==',' ) {
+ if( arg == NULL || arg[j] == '*' || i+1 < j )
+ p++; // the next argument is valid, skip the comma
+ }
+ else if( end2 && i == 0 && *p == ')' && *skip_space(p+1) == ',' )
+ {// parenthesis argument list fallback for "func (exp) , ..."
+ end = end2;
+ parse_syntax_for_flag = old_flag;
+ end2 = 0;
+ p=skip_space(p+1);
+ if( arg == NULL || arg[j] == '*' || i+1 < j )
p++; // the next argument is valid, skip the comma
}
else if(*p!=end && script_config.warn_cmd_no_comma){