diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-10-13 21:08:48 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-10-13 21:09:15 +0300 |
commit | ab731862f899dd87b84613ebf12a82cdc73e094f (patch) | |
tree | e0dff28ea24a942d0ad6d07783aadbccfc5022a7 /src/emap/itemdb.c | |
parent | f7cce6ac2d1c010af4865212dc6ddc2a7aea66a4 (diff) | |
download | evol-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.c | 4 |
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); } |