summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authormalufett <malufett.eat.my.binaries@gmail.com>2013-01-17 22:23:33 +0800
committermalufett <malufett.eat.my.binaries@gmail.com>2013-01-17 22:23:33 +0800
commit2bf913eebcc0a18057c9012be187585a7afb2f72 (patch)
treec6331085709e12e4fe58a915b05ed648924b4759 /src/map/atcommand.c
parent541c5f69913da208356ef68f556d3cb888d01911 (diff)
parent32ea0d89b449710473aab78d83840d22fccfd5b4 (diff)
downloadhercules-2bf913eebcc0a18057c9012be187585a7afb2f72.tar.gz
hercules-2bf913eebcc0a18057c9012be187585a7afb2f72.tar.bz2
hercules-2bf913eebcc0a18057c9012be187585a7afb2f72.tar.xz
hercules-2bf913eebcc0a18057c9012be187585a7afb2f72.zip
Merge remote-tracking branch 'origin/rathena'
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index c6292a7a9..2a18b7d2f 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -8585,7 +8585,7 @@ ACMD_FUNC(accinfo) {
ACMD_FUNC(set) {
char reg[32], val[128];
struct script_data* data;
- int toset = 0;
+ int toset = 0, len;
bool is_str = false;
if( !message || !*message || (toset = sscanf(message, "%32s %128[^\n]s", reg, val)) < 1 ) {
@@ -8607,6 +8607,13 @@ ACMD_FUNC(set) {
is_str = ( reg[strlen(reg) - 1] == '$' ) ? true : false;
+ if( ( len = strlen(val) ) > 1 ) {
+ if( val[0] == '"' && val[len-1] == '"') {
+ val[len-1] = '\0'; //Strip quotes.
+ memmove(val, val+1, len-1);
+ }
+ }
+
if( toset >= 2 ) {/* we only set the var if there is an val, otherwise we only output the value */
if( is_str )
set_var(sd, reg, (void*) val);