From ab731862f899dd87b84613ebf12a82cdc73e094f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 13 Oct 2015 21:08:48 +0300 Subject: Add support for take (pickup) script for items taked from ground by player. --- 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 478d88c..a689613 100644 --- a/src/emap/itemdb.c +++ b/src/emap/itemdb.c @@ -96,6 +96,8 @@ void eitemdb_readdb_additional_fields(int *itemid, if (libconfig->setting_lookup_string(it, "OnDropScript", &str)) 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; config_setting_t *group = libconfig->setting_get_member(it, "AllowCards"); if (group) @@ -134,4 +136,6 @@ void edestroy_item_data(struct item_data* self, int *free_selfPtr) if (data->dropScript) script->free_code(data->dropScript); + if (data->takeScript) + script->free_code(data->takeScript); } -- cgit v1.2.3-70-g09d2