summaryrefslogtreecommitdiff
path: root/src/map/clif.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-05-05 21:07:57 +0200
committerGitHub <noreply@github.com>2019-05-05 21:07:57 +0200
commit416acb084a7f04a61c410cbc8b31a85ae90c013f (patch)
treec471492e93d3ec53b21373c51f2e12afe935a22c /src/map/clif.h
parent892ed5f372f995786facfa8ce833711936754795 (diff)
parent112b19df8acb95e5599927fc4b505d4ca2e610a4 (diff)
downloadhercules-416acb084a7f04a61c410cbc8b31a85ae90c013f.tar.gz
hercules-416acb084a7f04a61c410cbc8b31a85ae90c013f.tar.bz2
hercules-416acb084a7f04a61c410cbc8b31a85ae90c013f.tar.xz
hercules-416acb084a7f04a61c410cbc8b31a85ae90c013f.zip
Merge pull request #2424 from hemagx/hercules_packet_fixes
Storage item list packet size fix and minor clif.c fixes
Diffstat (limited to 'src/map/clif.h')
-rw-r--r--src/map/clif.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/map/clif.h b/src/map/clif.h
index 6c9058cba..b3441f908 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -78,6 +78,11 @@ enum rodex_get_items;
#define COLOR_YELLOW 0xffff00U
#define COLOR_DEFAULT COLOR_GREEN
+#define MAX_STORAGE_ITEM_PACKET_NORMAL ((INT16_MAX - (sizeof(struct ZC_STORE_ITEMLIST_NORMAL) - (sizeof(struct NORMALITEM_INFO) * MAX_ITEMLIST))) / sizeof(struct NORMALITEM_INFO))
+#define MAX_STORAGE_ITEM_PACKET_EQUIP ((INT16_MAX - (sizeof(struct ZC_STORE_ITEMLIST_EQUIP) - (sizeof(struct EQUIPITEM_INFO) * MAX_ITEMLIST))) / sizeof(struct EQUIPITEM_INFO))
+STATIC_ASSERT(MAX_STORAGE_ITEM_PACKET_NORMAL > 0, "Max items per storage item packet for normal items is less than 1, it's most likely to be a bug and shall not be ignored.");
+STATIC_ASSERT(MAX_STORAGE_ITEM_PACKET_EQUIP > 0, "Max items per storage item packet for equip items is less than 1, it's most likely to be a bug and shall not be ignored.");
+
/**
* Enumerations
**/