summaryrefslogtreecommitdiff
path: root/src/emap/itemdb.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-10-13 21:08:48 +0300
committerAndrei Karas <akaras@inbox.ru>2015-10-13 21:09:15 +0300
commitab731862f899dd87b84613ebf12a82cdc73e094f (patch)
treee0dff28ea24a942d0ad6d07783aadbccfc5022a7 /src/emap/itemdb.c
parentf7cce6ac2d1c010af4865212dc6ddc2a7aea66a4 (diff)
downloadevol-hercules-ab731862f899dd87b84613ebf12a82cdc73e094f.tar.gz
evol-hercules-ab731862f899dd87b84613ebf12a82cdc73e094f.tar.bz2
evol-hercules-ab731862f899dd87b84613ebf12a82cdc73e094f.tar.xz
evol-hercules-ab731862f899dd87b84613ebf12a82cdc73e094f.zip
Add support for take (pickup) script for items taked from ground by player.
Diffstat (limited to 'src/emap/itemdb.c')
-rw-r--r--src/emap/itemdb.c4
1 files changed, 4 insertions, 0 deletions
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);
}