summaryrefslogtreecommitdiff
path: root/src/map/data
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/data')
-rw-r--r--src/map/data/itemd.c9
-rw-r--r--src/map/data/itemd.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/map/data/itemd.c b/src/map/data/itemd.c
index a862617..7b7bda7 100644
--- a/src/map/data/itemd.c
+++ b/src/map/data/itemd.c
@@ -16,6 +16,15 @@
#include "map/data/itemd.h"
#include "map/struct/itemdext.h"
+struct ItemdExt *itemd_get_by_item(struct item *item)
+{
+ if (!item)
+ return NULL;
+ const int nameid = item->nameid;
+ struct item_data *item_data = itemdb->exists(nameid);
+ return itemd_get(item_data);
+}
+
struct ItemdExt *itemd_get(struct item_data *item)
{
if (!item)
diff --git a/src/map/data/itemd.h b/src/map/data/itemd.h
index 611d6cd..d3c529b 100644
--- a/src/map/data/itemd.h
+++ b/src/map/data/itemd.h
@@ -6,6 +6,7 @@
struct ItemdExt;
+struct ItemdExt *itemd_get_by_item(struct item *item);
struct ItemdExt *itemd_get(struct item_data *item);
struct ItemdExt *itemd_create(void);