diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-01-29 00:05:43 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-01-29 00:05:43 +0300 |
commit | 9598d5c5079f8d3d4e0b9f78580ba8b763b4498d (patch) | |
tree | 1283a92d206ad1771a6c3178cc6ab65ec33dd9d3 /src/emap/script.c | |
parent | 13679e2600d188a615d8f05dfe56c61341496588 (diff) | |
download | evol-hercules-9598d5c5079f8d3d4e0b9f78580ba8b763b4498d.tar.gz evol-hercules-9598d5c5079f8d3d4e0b9f78580ba8b763b4498d.tar.bz2 evol-hercules-9598d5c5079f8d3d4e0b9f78580ba8b763b4498d.tar.xz evol-hercules-9598d5c5079f8d3d4e0b9f78580ba8b763b4498d.zip |
Change script function requestitems to return value.
Diffstat (limited to 'src/emap/script.c')
-rw-r--r-- | src/emap/script.c | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/src/emap/script.c b/src/emap/script.c index ebfbd77..2f853ca 100644 --- a/src/emap/script.c +++ b/src/emap/script.c @@ -683,34 +683,12 @@ BUILDIN(requestItem) BUILDIN(requestItems) { - getSD(); - struct script_data* data; - int64 uid; - const char* name; - - data = script_getdata(st, 2); - if (!data_isreference(data)) - { - ShowError("script:requestitem: not a variable\n"); - script->reportsrc(st); - st->state = END; - return false; - } - uid = reference_getuid(data); - name = reference_getname(data); - - if (!is_string_variable(name)) - { - ShowWarning("parameter is not variable\n"); - script->reportsrc(st); - return false; - } - + getSDReturnS("0,0"); int count = 1; - if (script_hasdata(st, 3)) + if (script_hasdata(st, 2)) { - count = script_getnum(st, 3); + count = script_getnum(st, 2); if (count < 0) count = 1; } @@ -732,11 +710,12 @@ BUILDIN(requestItems) if (!sd->npc_str) { ShowWarning("npc string not found\n"); + script_pushstr(st, aStrdup("0,0")); script->reportsrc(st); return false; } - script->set_reg(st, sd, uid, name, (void*)sd->npc_str, script_getref(st, 2)); + script_pushstr(st, aStrdup(sd->npc_str)); st->state = RUN; } return true; |