diff options
-rw-r--r-- | src/map/clif.c | 17 | ||||
-rw-r--r-- | src/map/packets_struct.h | 8 |
2 files changed, 16 insertions, 9 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 988f60417..310bbebff 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -3951,17 +3951,16 @@ static void clif_arrow_create_list(struct map_session_data *sd) /// 1 = success static void clif_statusupack(struct map_session_data *sd, int type, int ok, int val) { - int fd; - nullpo_retv(sd); + int fd = sd->fd; - fd=sd->fd; - WFIFOHEAD(fd,packet_len(0xbc)); - WFIFOW(fd,0)=0xbc; - WFIFOW(fd,2)=type; - WFIFOB(fd,4)=ok; - WFIFOB(fd,5)=cap_value(val,0,UINT8_MAX); - WFIFOSET(fd,packet_len(0xbc)); + WFIFOHEAD(fd, sizeof(struct PACKET_ZC_STATUS_CHANGE_ACK)); + struct PACKET_ZC_STATUS_CHANGE_ACK *p = WFIFOP(fd, 0); + p->packetType = HEADER_ZC_STATUS_CHANGE_ACK; + p->sp = type; + p->ok = ok; + p->value = cap_value(val, 0, UINT8_MAX); + WFIFOSET(fd, sizeof(struct PACKET_ZC_STATUS_CHANGE_ACK)); } /// Notifies the client about the result of a request to equip an item (ZC_REQ_WEAR_EQUIP_ACK). diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 5566b5581..aeb57bdc4 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -3514,6 +3514,14 @@ struct PACKET_ZC_ACK_RANKING_sub { } __attribute__((packed)); #endif +struct PACKET_ZC_STATUS_CHANGE_ACK { + int16 packetType; + uint16 sp; + uint8 ok; + uint8 value; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_STATUS_CHANGE_ACK, 0x00bc); + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris |