summaryrefslogtreecommitdiff
path: root/src/map/itemdb.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-18 11:18:07 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-18 11:18:07 +0300
commitda93a53f7630a62f342f51743d63914f3ea5f266 (patch)
treea38650a74cb03e6a3ee66180e91af3dbf2c3a3a7 /src/map/itemdb.c
parent4537814684bc50d1154d9f54500c0602303ca862 (diff)
downloadevol-hercules-da93a53f7630a62f342f51743d63914f3ea5f266.tar.gz
evol-hercules-da93a53f7630a62f342f51743d63914f3ea5f266.tar.bz2
evol-hercules-da93a53f7630a62f342f51743d63914f3ea5f266.tar.xz
evol-hercules-da93a53f7630a62f342f51743d63914f3ea5f266.zip
Read paramater FloorLifeTime from item_db.
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r--src/map/itemdb.c24
1 files changed, 20 insertions, 4 deletions
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;
+}