summaryrefslogtreecommitdiff
path: root/src/emap/script.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-01-24 17:48:55 +0300
committerAndrei Karas <akaras@inbox.ru>2016-01-24 17:48:55 +0300
commitce563a50ff4997f4a3f1ccd8bd1fdec5708b3bff (patch)
tree163c40267ec7ad9edf32ec6a3e06a12f6b1132b0 /src/emap/script.c
parente7cd9086185804d815fb0dc72e3bfd36fdd9a33f (diff)
downloadevol-hercules-ce563a50ff4997f4a3f1ccd8bd1fdec5708b3bff.tar.gz
evol-hercules-ce563a50ff4997f4a3f1ccd8bd1fdec5708b3bff.tar.bz2
evol-hercules-ce563a50ff4997f4a3f1ccd8bd1fdec5708b3bff.tar.xz
evol-hercules-ce563a50ff4997f4a3f1ccd8bd1fdec5708b3bff.zip
Add script function for get return code from craft entry.
New script function: getcraftcode ENTRY
Diffstat (limited to 'src/emap/script.c')
-rw-r--r--src/emap/script.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/emap/script.c b/src/emap/script.c
index 69c1f4e..bc8c7b2 100644
--- a/src/emap/script.c
+++ b/src/emap/script.c
@@ -1954,10 +1954,17 @@ BUILDIN(findCraftEntry)
BUILDIN(useCraft)
{
- getSDReturn(0)
+ getSD()
return craft_use(sd, script_getnum(st, 2));
}
+BUILDIN(getCraftCode)
+{
+ getSDReturn(-1)
+ script_pushint(st, craft_get_entry_code(sd, script_getnum(st, 2)));
+ return true;
+}
+
BUILDIN(getInvIndexLink)
{
getSDReturnS("")