diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-01-28 23:54:28 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-01-28 23:54:28 +0300 |
commit | 13679e2600d188a615d8f05dfe56c61341496588 (patch) | |
tree | 3129877b55a37270da2a83763a0a5e1a7bab879a /src/emap/script.c | |
parent | cbe15f5cc7338e9f1b7744bfd6bbbe44c9db115c (diff) | |
download | evol-hercules-13679e2600d188a615d8f05dfe56c61341496588.tar.gz evol-hercules-13679e2600d188a615d8f05dfe56c61341496588.tar.bz2 evol-hercules-13679e2600d188a615d8f05dfe56c61341496588.tar.xz evol-hercules-13679e2600d188a615d8f05dfe56c61341496588.zip |
Change script function requestitem to return value.
Diffstat (limited to 'src/emap/script.c')
-rw-r--r-- | src/emap/script.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/src/emap/script.c b/src/emap/script.c index f079215..ebfbd77 100644 --- a/src/emap/script.c +++ b/src/emap/script.c @@ -641,28 +641,7 @@ BUILDIN(requestLang) BUILDIN(requestItem) { - 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)) - { - ShowError("script:requestitem: not a variable\n"); - script->reportsrc(st); - return false; - } + getSDReturn(0); if (!sd->state.menu_or_input) { @@ -683,6 +662,7 @@ BUILDIN(requestItem) if (!sd->npc_str) { ShowWarning("npc string not found\n"); + script_pushint(st, 0); script->reportsrc(st); return false; } @@ -690,11 +670,12 @@ BUILDIN(requestItem) if (sscanf (sd->npc_str, "%5d", &item) < 1) { ShowWarning("input data is not item id\n"); + script_pushint(st, 0); script->reportsrc(st); return false; } - script->set_reg(st, sd, uid, name, (void*)h64BPTRSIZE(item), script_getref(st,2)); + script_pushint(st, item); st->state = RUN; } return true; |