diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/clif.c | 41 | ||||
-rw-r--r-- | src/map/mob.c | 3 | ||||
-rw-r--r-- | src/map/refine.c | 2 | ||||
-rw-r--r-- | src/map/status.h | 4 |
4 files changed, 42 insertions, 8 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 12e6a06c2..721d2f5b5 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) @@ -9270,11 +9301,11 @@ static void clif_pcname_ack(int fd, struct block_list *bl) int ps = -1; if (ssd->fakename[0] != '\0' && ssd->disguise != -1) { - packet.packet_id = HEADER_ZC_ACK_REQNAMEALL; - len = sizeof(struct PACKET_ZC_ACK_REQNAMEALL); - } else { packet.packet_id = reqName; len = sizeof(struct packet_reqname_ack); + } else { + packet.packet_id = HEADER_ZC_ACK_REQNAMEALL; + len = sizeof(struct PACKET_ZC_ACK_REQNAMEALL); } //Requesting your own "shadow" name. [Skotlex] @@ -19522,6 +19553,7 @@ static void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) static void clif_cashShopBuyAck(int fd, struct map_session_data *sd, int itemId, enum CASH_SHOP_BUY_RESULT result) { +#if PACKETVER_MAIN_NUM >= 20101123 || PACKETVER_RE_NUM >= 20120328 || defined(PACKETVER_ZERO) nullpo_retv(sd); WFIFOHEAD(fd, sizeof(struct PACKET_ZC_SE_PC_BUY_CASHITEM_RESULT)); struct PACKET_ZC_SE_PC_BUY_CASHITEM_RESULT *p = WFIFOP(fd, 0); @@ -19531,6 +19563,7 @@ static void clif_cashShopBuyAck(int fd, struct map_session_data *sd, int itemId, p->cashPoints = sd->cashPoints; p->kafraPoints = sd->kafraPoints; WFIFOSET(fd, sizeof(struct PACKET_ZC_SE_PC_BUY_CASHITEM_RESULT)); +#endif } static void clif_parse_CashShopReqTab(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); diff --git a/src/map/mob.c b/src/map/mob.c index 8dac1ea43..aa938a1e7 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2699,7 +2699,8 @@ static int mob_dead(struct mob_data *md, struct block_list *src, int type) item.nameid = mdrop[i].nameid; item.identify = itemdb->isidentified2(data); - mob->setdropitem_options(&item, mdrop[i].options); + if (mdrop[i].options != NULL) + mob->setdropitem_options(&item, mdrop[i].options); clif->mvp_item(mvp_sd, item.nameid); log_mvp[0] = item.nameid; diff --git a/src/map/refine.c b/src/map/refine.c index 1ff893c56..4fe6e73c4 100644 --- a/src/map/refine.c +++ b/src/map/refine.c @@ -528,7 +528,7 @@ static int refine_readdb_refine_libconfig_sub(struct config_setting_t *r, const chance[i][j] = 100; // default value for all rates. struct config_setting_t *t = NULL; - for (int i = 0; (t = libconfig->setting_get_elem(rate, i++)) != NULL && config_setting_is_group(t); ++i) { + for (int i = 0; (t = libconfig->setting_get_elem(rate, i)) != NULL && config_setting_is_group(t); ++i) { int level = 0, i32; char *rlvl = config_setting_name(t); memset(&lv, 0, sizeof(lv)); diff --git a/src/map/status.h b/src/map/status.h index a70687b67..5f53b715a 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -2064,8 +2064,8 @@ struct status_data { matk_min, matk_max, speed, amotion, adelay, dmotion, - mode, - hit, flee, cri, flee2, + mode; + int32 hit, flee, cri, flee2, def2, mdef2, #ifdef RENEWAL_ASPD aspd_rate2, |