From 083278009ab0d94d305754c14c7372b61f410931 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 24 Dec 2014 23:22:07 +0300 Subject: Add into item_db.conf option AllowPickup, by default true. It allow pickup item from ground. --- src/map/data/itemd.c | 1 + src/map/itemdb.c | 5 +++++ src/map/struct/itemdext.h | 1 + 3 files changed, 7 insertions(+) (limited to 'src/map') diff --git a/src/map/data/itemd.c b/src/map/data/itemd.c index 7b7bda7..759bd63 100644 --- a/src/map/data/itemd.c +++ b/src/map/data/itemd.c @@ -46,5 +46,6 @@ struct ItemdExt *itemd_create(void) if (!data) return NULL; data->floorLifeTime = battle->bc->flooritem_lifetime; + data->allowPickup = true; return data; } diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 587441c..cccabc5 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -44,7 +44,12 @@ void eitemdb_readdb_additional_fields(int *itemid, return; } + config_setting_t *t = NULL; + if (libconfig->setting_lookup_int(it, "FloorLifeTime", &i32) && i32 >= 0) data->floorLifeTime = i32; + if ((t = libconfig->setting_get_member(it, "AllowPickup"))) + data->allowPickup = libconfig->setting_get_bool(t) ? 1 : 0; + hookStop(); } diff --git a/src/map/struct/itemdext.h b/src/map/struct/itemdext.h index 837f5bb..4dce554 100644 --- a/src/map/struct/itemdext.h +++ b/src/map/struct/itemdext.h @@ -7,6 +7,7 @@ struct ItemdExt { int floorLifeTime; + bool allowPickup; }; #endif // EVOL_MAP_ITEMDEXT -- cgit v1.2.3-60-g2f50