summaryrefslogtreecommitdiff
path: root/src/emap/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emap/script.c')
-rw-r--r--src/emap/script.c28
1 files changed, 4 insertions, 24 deletions
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;