From 0e55e85e9e9a6a4028a29e8c214b69cbc3a54ffe Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 17 Oct 2015 16:15:51 +0300 Subject: Add support for insert cards script. --- src/emap/itemdb.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/emap/itemdb.c') diff --git a/src/emap/itemdb.c b/src/emap/itemdb.c index a689613..9b0aabb 100644 --- a/src/emap/itemdb.c +++ b/src/emap/itemdb.c @@ -98,6 +98,8 @@ void eitemdb_readdb_additional_fields(int *itemid, data->dropScript = *str ? script->parse(str, source, -item->nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL; if (libconfig->setting_lookup_string(it, "OnTakeScript", &str)) data->takeScript = *str ? script->parse(str, source, -item->nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL; + if (libconfig->setting_lookup_string(it, "OnInsertCardScript", &str)) + data->insertScript = *str ? script->parse(str, source, -item->nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL; config_setting_t *group = libconfig->setting_get_member(it, "AllowCards"); if (group) @@ -138,4 +140,6 @@ void edestroy_item_data(struct item_data* self, int *free_selfPtr) script->free_code(data->dropScript); if (data->takeScript) script->free_code(data->takeScript); + if (data->insertScript) + script->free_code(data->insertScript); } -- cgit v1.2.3-70-g09d2