From ce563a50ff4997f4a3f1ccd8bd1fdec5708b3bff Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 24 Jan 2016 17:48:55 +0300 Subject: Add script function for get return code from craft entry. New script function: getcraftcode ENTRY --- src/emap/craft.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/emap/craft.c') diff --git a/src/emap/craft.c b/src/emap/craft.c index 2ea33bc..7081911 100644 --- a/src/emap/craft.c +++ b/src/emap/craft.c @@ -834,3 +834,15 @@ bool craft_use(TBL_PC *sd, clif->updatestatus(sd, SP_WEIGHT); return true; } + +int craft_get_entry_code(TBL_PC *sd, + const int id) +{ + struct craft_db_entry *entry = idb_get(craftconf_db, id); + if (!entry) + { + ShowError("Craft config entry with id %d not exists.\n", id); + return -1; + } + return entry->return_code; +} -- cgit v1.2.3-70-g09d2