summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-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);