diff options
author | gumi <mekolat@users.noreply.github.com> | 2017-07-11 10:18:28 -0400 |
---|---|---|
committer | gumi <mekolat@users.noreply.github.com> | 2017-07-11 10:18:43 -0400 |
commit | 67f43dbe233ec0b2649e7c7762b4760a8fcc0183 (patch) | |
tree | 012b52c983cb878509ece65cf4eb3db5d62db169 | |
parent | c1e48f9f96ebd67d42fc2146867a4b78b5529b38 (diff) | |
parent | 2c86a89a0a3e8a80140df9323de2618f10042859 (diff) | |
download | hercules-67f43dbe233ec0b2649e7c7762b4760a8fcc0183.tar.gz hercules-67f43dbe233ec0b2649e7c7762b4760a8fcc0183.tar.bz2 hercules-67f43dbe233ec0b2649e7c7762b4760a8fcc0183.tar.xz hercules-67f43dbe233ec0b2649e7c7762b4760a8fcc0183.zip |
merge meko/set-sd2
-rw-r--r-- | src/map/script.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/map/script.c b/src/map/script.c index bef3dc13a..628598584 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -7039,6 +7039,7 @@ BUILDIN(__setr) int64 num; const char* name; char prefix; + struct reg_db *ref; data = script_getdata(st,2); //datavalue = script_getdata(st,3); @@ -7051,11 +7052,11 @@ BUILDIN(__setr) num = reference_getuid(data); name = reference_getname(data); + ref = reference_getref(data); prefix = *name; if (not_server_variable(prefix)) { - sd = script->rid2sd(st); - if (sd == NULL) { + if (ref == NULL && (sd = script->rid2sd(st)) == NULL) { ShowError("script:set: no player attached for player variable '%s'\n", name); return true; } @@ -7103,9 +7104,9 @@ BUILDIN(__setr) } if (is_string_variable(name)) - script->set_reg(st, sd, num, name, script_getstr(st, 3), script_getref(st, 2)); + script->set_reg(st, sd, num, name, script_getstr(st, 3), ref); else - script->set_reg(st, sd, num, name, (const void *)h64BPTRSIZE(script_getnum(st, 3)), script_getref(st, 2)); + script->set_reg(st, sd, num, name, (const void *)h64BPTRSIZE(script_getnum(st, 3)), ref); return true; } |