summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-05-08 00:50:20 +0200
committerGitHub <noreply@github.com>2019-05-08 00:50:20 +0200
commit6546beefaa8d3cb6141e2414396b0dbca6eb5d15 (patch)
tree8541e4ea7b7700c403f06f047b28cc187ac61fc5
parent4f6bde369c117585a6c17640811b1ee62bf648ff (diff)
parentc85f93d1cff5d5b053a1e21ea38d6d38beec6a70 (diff)
downloadhercules-6546beefaa8d3cb6141e2414396b0dbca6eb5d15.tar.gz
hercules-6546beefaa8d3cb6141e2414396b0dbca6eb5d15.tar.bz2
hercules-6546beefaa8d3cb6141e2414396b0dbca6eb5d15.tar.xz
hercules-6546beefaa8d3cb6141e2414396b0dbca6eb5d15.zip
Merge pull request #2464 from 4144/fix2463
Fix sending guild storage to client (Fixes #2463)
-rw-r--r--src/map/clif.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 1214106b7..2f1594477 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -2978,7 +2978,8 @@ static void clif_storageItems(struct map_session_data *sd, enum inventory_type t
nullpo_retv(sd);
nullpo_retv(items);
- for (int i = 0, normal_count = 0, equip_count = 0; i < items_length; ++i) {
+ int normal_count = 0, equip_count = 0;
+ for (int i = 0; i < items_length; ++i) {
if (items[i].nameid == 0)
continue;
@@ -3019,6 +3020,36 @@ static void clif_storageItems(struct map_session_data *sd, enum inventory_type t
equip_count = 0;
}
}
+
+ if (normal_count > 0) {
+ storelist_normal.PacketType = storageListNormalType;
+ storelist_normal.PacketLength = (sizeof(storelist_normal) - sizeof(storelist_normal.list)) + (sizeof(struct NORMALITEM_INFO) * normal_count);
+
+#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002
+ storelist_normal.invType = type;
+#endif
+#if PACKETVER >= 20120925 && PACKETVER_RE_NUM < 20180829 && PACKETVER_ZERO_NUM < 20180919 && PACKETVER_MAIN_NUM < 20181002
+ safestrncpy(storelist_normal.name, "Storage", NAME_LENGTH);
+#endif
+
+ clif->send(&storelist_normal, storelist_normal.PacketLength, &sd->bl, SELF);
+ normal_count = 0;
+ }
+
+ if (equip_count > 0) {
+ storelist_equip.PacketType = storageListEquipType;
+ storelist_equip.PacketLength = (sizeof(storelist_equip) - sizeof(storelist_equip.list)) + (sizeof(struct EQUIPITEM_INFO) * equip_count);
+
+#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002
+ storelist_equip.invType = type;
+#endif
+#if PACKETVER >= 20120925 && PACKETVER_RE_NUM < 20180829 && PACKETVER_ZERO_NUM < 20180919 && PACKETVER_MAIN_NUM < 20181002
+ safestrncpy(storelist_equip.name, "Storage", NAME_LENGTH);
+#endif
+
+ clif->send(&storelist_equip, storelist_equip.PacketLength, &sd->bl, SELF);
+ equip_count = 0;
+ }
}
static void clif_cartList(struct map_session_data *sd)