summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-07-10 22:03:45 +0300
committerAndrei Karas <akaras@inbox.ru>2018-07-15 20:36:27 +0300
commitfd081fbacb8cc1a8fdcbacfa1923c4b7c17510a4 (patch)
tree6a2897782bf46bcacdaced9a713d3150087d58d4 /src/map/clif.c
parent8c62eb43def49ebd089b4287d78f9b64ea673090 (diff)
downloadhercules-fd081fbacb8cc1a8fdcbacfa1923c4b7c17510a4.tar.gz
hercules-fd081fbacb8cc1a8fdcbacfa1923c4b7c17510a4.tar.bz2
hercules-fd081fbacb8cc1a8fdcbacfa1923c4b7c17510a4.tar.xz
hercules-fd081fbacb8cc1a8fdcbacfa1923c4b7c17510a4.zip
Update packet ZC_NOTIFY_WEAPONITEMLIST.
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index e1825203d..410ef1b7d 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -6359,30 +6359,34 @@ static void clif_item_refine_list(struct map_session_data *sd)
{
int i,c;
int fd;
+ int len;
+ struct PACKET_ZC_NOTIFY_WEAPONITEMLIST *p;
uint16 skill_lv;
nullpo_retv(sd);
- skill_lv = pc->checkskill(sd,WS_WEAPONREFINE);
-
- fd=sd->fd;
+ skill_lv = pc->checkskill(sd, WS_WEAPONREFINE);
- WFIFOHEAD(fd, MAX_INVENTORY * 13 + 4);
- WFIFOW(fd,0)=0x221;
+ fd = sd->fd;
+ len = MAX_INVENTORY * sizeof(struct PACKET_ZC_NOTIFY_WEAPONITEMLIST_sub) + sizeof(struct PACKET_ZC_NOTIFY_WEAPONITEMLIST);
+ WFIFOHEAD(fd, len);
+ p = WFIFOP(fd, 0);
+ p->packetType = 0x221;
for (i = c = 0; i < MAX_INVENTORY; i++) {
- if(sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].identify
+ if (sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].identify
&& itemdb_wlv(sd->status.inventory[i].nameid) >= 1
&& !sd->inventory_data[i]->flag.no_refine
- && !(sd->status.inventory[i].equip&EQP_ARMS)){
- WFIFOW(fd,c*13+ 4)=i+2;
- WFIFOW(fd,c*13+ 6)=sd->status.inventory[i].nameid;
- WFIFOB(fd,c*13+ 8)=sd->status.inventory[i].refine;
- clif->addcards((struct EQUIPSLOTINFO*)WFIFOP(fd, c * 13 + 9), &sd->status.inventory[i]);
+ && !(sd->status.inventory[i].equip & EQP_ARMS)) {
+ p->items[c].index = i + 2;
+ p->items[c].itemId = sd->status.inventory[i].nameid;
+ p->items[c].refine = sd->status.inventory[i].refine;
+ clif->addcards(&p->items[c].slot, &sd->status.inventory[i]);
c++;
}
}
- WFIFOW(fd,2)=c*13+4;
- WFIFOSET(fd,WFIFOW(fd,2));
+ len = c * sizeof(struct PACKET_ZC_NOTIFY_WEAPONITEMLIST_sub) + sizeof(struct PACKET_ZC_NOTIFY_WEAPONITEMLIST);
+ p->packetLength = len;
+ WFIFOSET(fd, len);
if (c > 0) {
sd->menuskill_id = WS_WEAPONREFINE;
sd->menuskill_val = skill_lv;