From da93a53f7630a62f342f51743d63914f3ea5f266 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 18 Dec 2014 11:18:07 +0300 Subject: Read paramater FloorLifeTime from item_db. --- src/map/itemdb.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/map/itemdb.c') diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 0057a75..5d1f51b 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -15,10 +15,8 @@ #include "../../../map/npc.h" #include "../../../map/pc.h" -#include "map/data/mapd.h" -#include "map/data/npcd.h" -#include "map/struct/mapdext.h" -#include "map/struct/npcdext.h" +#include "map/data/itemd.h" +#include "map/struct/itemdext.h" #include "map/npc.h" bool eitemdb_is_item_usable(struct item_data *item) @@ -26,3 +24,21 @@ bool eitemdb_is_item_usable(struct item_data *item) hookStop(); return item->type == IT_HEALING || item->type == IT_USABLE || item->type == IT_CASH || item->type == IT_PETEGG; } + +void eitemdb_readdb_additional_fields(int *itemid, + config_setting_t *it, + int *n __attribute__ ((unused)), + const char *source __attribute__ ((unused))) +{ + hookStop(); + struct item_data *item = itemdb->exists(*itemid); + int i32 = 0; + if (!item) + return; + struct ItemdExt *data = itemd_get(item); + if (!data) + return; + + if (libconfig->setting_lookup_int(it, "FloorLifeTime", &i32) && i32 >= 0) + data->floorLifeTime = i32; +} -- cgit v1.2.3-60-g2f50