diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-01-23 19:21:12 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-01-23 19:21:12 +0300 |
commit | 44c32f2268b64fc44b4b5553efaf07021e6faea9 (patch) | |
tree | 6e291bfd8c0af2babc4b2cdd32c1d6d330e108de /src | |
parent | 80956ecdab280f24708981f71bac50ec23587311 (diff) | |
download | evol-hercules-44c32f2268b64fc44b4b5553efaf07021e6faea9.tar.gz evol-hercules-44c32f2268b64fc44b4b5553efaf07021e6faea9.tar.bz2 evol-hercules-44c32f2268b64fc44b4b5553efaf07021e6faea9.tar.xz evol-hercules-44c32f2268b64fc44b4b5553efaf07021e6faea9.zip |
Remove var name parameter from requestCraft. Now it return string.
Diffstat (limited to 'src')
-rw-r--r-- | src/emap/init.c | 2 | ||||
-rw-r--r-- | src/emap/script.c | 28 |
2 files changed, 5 insertions, 25 deletions
diff --git a/src/emap/init.c b/src/emap/init.c index 06937a5..ddff203 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -101,7 +101,7 @@ HPExport void plugin_init (void) addScriptCommand("requestitems", "v*", requestItems); addScriptCommand("requestitemindex", "v", requestItemIndex); addScriptCommand("requestitemsindex", "v*", requestItemsIndex); - addScriptCommand("requestcraft", "v*", requestCraft); + addScriptCommand("requestcraft", "*", requestCraft); addScriptCommand("initcraft", "s", initCraft); addScriptCommand("dumpcraft", "i", dumpCraft); addScriptCommand("deletecraft", "i", deleteCraft); diff --git a/src/emap/script.c b/src/emap/script.c index 6ee42df..a7aac63 100644 --- a/src/emap/script.c +++ b/src/emap/script.c @@ -880,33 +880,12 @@ BUILDIN(requestItemsIndex) BUILDIN(requestCraft) { getSessionData(client); - 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; - } 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; } @@ -932,10 +911,11 @@ BUILDIN(requestCraft) { ShowWarning("npc string not found\n"); script->reportsrc(st); + script_pushstr(st, aStrdup("")); 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; |