summaryrefslogtreecommitdiff
path: root/src/map/itemdb.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-07-17 02:57:06 +0300
committerAndrei Karas <akaras@inbox.ru>2018-07-19 21:53:40 +0300
commit2f80262667ece77ceb69de42b2cc4ce84aed6881 (patch)
tree326d86dae61a32bbd5a51ad9f2afdf2c91aba07a /src/map/itemdb.h
parentb67565957203e5efae25b1a29d072c1b954ce394 (diff)
downloadhercules-2f80262667ece77ceb69de42b2cc4ce84aed6881.tar.gz
hercules-2f80262667ece77ceb69de42b2cc4ce84aed6881.tar.bz2
hercules-2f80262667ece77ceb69de42b2cc4ce84aed6881.tar.xz
hercules-2f80262667ece77ceb69de42b2cc4ce84aed6881.zip
Add new constant MAX_ITEM_ID for maximum allowed item id.
For clients older than 2018-07-04 Re maximum supported and enabled id is 65535 (0xffff). For newer clients miximum id is 2147483648. Enabled by default 131072 (0x20000)
Diffstat (limited to 'src/map/itemdb.h')
-rw-r--r--src/map/itemdb.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index 6cce715d3..d92940445 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -36,12 +36,23 @@ struct hplugin_data_store;
#ifndef MAX_ITEMDB
#define MAX_ITEMDB 0xFFFF
#endif
+
+#ifndef MAX_ITEM_ID
+#if PACKETVER_RE_NUM >= 20180704
+#define MAX_ITEM_ID 0x20000
+#else
+#define MAX_ITEM_ID 0xFFFF
+#endif
+#endif
+
#ifndef MAX_ITEMDELAYS
#define MAX_ITEMDELAYS 10 // The maximum number of item delays
#endif
+
#ifndef MAX_SEARCH
#define MAX_SEARCH 5 //Designed for search functions, species max number of matches to display.
#endif
+
#ifndef MAX_ITEMS_PER_COMBO
#define MAX_ITEMS_PER_COMBO 6 /* maximum amount of items a combo may require */
#endif
@@ -58,6 +69,13 @@ struct hplugin_data_store;
#define UNKNOWN_ITEM_ID 512
#endif
+#if MAX_ITEM_ID < MAX_ITEMDB
+#error "MAX_ITEM_ID must be bigger or same with MAX_ITEMDB"
+#endif
+#if MAX_ITEM_ID > 0xFFFF && PACKETVER_RE_NUM < 20180704
+#error "For clients before 20180704 RE, MAX_ITEM_ID must be smaller than 0x10000"
+#endif
+
enum item_itemid {
ITEMID_RED_POTION = 501,
ITEMID_YELLOW_POTION = 503,
@@ -409,13 +427,13 @@ struct item_combo {
};
struct item_group {
- unsigned short id;
+ int id;
int *nameid;
unsigned short qty;
};
struct item_chain_entry {
- unsigned short id;
+ int id;
unsigned short rate;
struct item_chain_entry *next;
};
@@ -426,7 +444,7 @@ struct item_chain {
};
struct item_package_rand_entry {
- unsigned short id;
+ int id;
unsigned short qty;
unsigned short rate;
unsigned short hours;