diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-12-12 01:38:41 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-12-12 01:38:41 +0000 |
commit | 664d34d836c774fde315d28b2b96db816573b357 (patch) | |
tree | 96828cb6642eb662554974b51ce341d133d61767 | |
parent | 44539d3a09582fb5fb251578c70b8974bd20aafb (diff) | |
download | hercules-664d34d836c774fde315d28b2b96db816573b357.tar.gz hercules-664d34d836c774fde315d28b2b96db816573b357.tar.bz2 hercules-664d34d836c774fde315d28b2b96db816573b357.tar.xz hercules-664d34d836c774fde315d28b2b96db816573b357.zip |
* Fixed script command setd always assuming value parameter to be a string, which causes hexadecimal and octal numbers not being handled properly (topic:261833, followup to r14577 and r14578).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14581 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 1 | ||||
-rw-r--r-- | src/map/script.c | 9 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 084a09c3d..6f4f42cf1 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -1,6 +1,7 @@ Date Added 2010/12/11 + * Fixed script command setd always assuming value parameter to be a string, which causes hexadecimal and octal numbers not being handled properly (topic:261833, followup to r14577 and r14578). [Ai4rei] * Updates to dynamic server information `ragsrvinfo` on SQL. [Ai4rei] - Fixed exp and drop rates (int) getting truncated (short) when sent to char-server. - Removed `motd` from `ragsrvinfo` as it is not dynamically changed by the server and as such can be read by 3rd party applications directly from conf/motd.txt if required. diff --git a/src/map/script.c b/src/map/script.c index a231f9d3a..c408846a3 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -12355,10 +12355,9 @@ BUILDIN_FUNC(setd) { TBL_PC *sd=NULL; char varname[100]; - const char *value, *buffer; + const char *buffer; int elem; buffer = script_getstr(st, 2); - value = script_getstr(st, 3); if(sscanf(buffer, "%99[^[][%d]", varname, &elem) < 2) elem = 0; @@ -12373,10 +12372,10 @@ BUILDIN_FUNC(setd) } } - if(varname[strlen(varname)-1] != '$') { - setd_sub(st,sd, varname, elem, (void *)atoi(value),NULL); + if( is_string_variable(varname) ) { + setd_sub(st, sd, varname, elem, (void *)script_getstr(st, 3), NULL); } else { - setd_sub(st,sd, varname, elem, (void *)value,NULL); + setd_sub(st, sd, varname, elem, (void *)script_getnum(st, 3), NULL); } return 0; |