From d48884f776c943b32bf432076ac28180a4410b06 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 15 Dec 2014 13:57:12 +0300 Subject: Move check is item usable or not to separate method. New method: itemdb_is_item_usable Can be used as: itemdb->is_item_usable(item) --- src/map/itemdb.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/map/itemdb.c') diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 508a0ccec..545ce9ba0 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -2054,6 +2054,14 @@ struct item_combo * itemdb_id2combo( unsigned short id ) { return itemdb->combos[id]; } +/** + * check is item have usable type + **/ +bool itemdb_is_item_usable(struct item_data *item) +{ + return item->type == IT_HEALING || item->type == IT_USABLE || item->type == IT_CASH; +} + /*========================================== * Initialize / Finalize *------------------------------------------*/ @@ -2337,4 +2345,5 @@ void itemdb_defaults(void) { itemdb->final_sub = itemdb_final_sub; itemdb->clear = itemdb_clear; itemdb->id2combo = itemdb_id2combo; + itemdb->is_item_usable = itemdb_is_item_usable; } -- cgit v1.2.3-60-g2f50