diff options
-rw-r--r-- | src/map/clif.c | 13 | ||||
-rw-r--r-- | src/map/packets_struct.h | 9 |
2 files changed, 16 insertions, 6 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 2cb3bebaa..db3d4beef 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11949,10 +11949,11 @@ static void clif_parse_Cooking(int fd, struct map_session_data *sd) __attribute_ /// 6 = GN_S_PHARMACY static void clif_parse_Cooking(int fd, struct map_session_data *sd) { - int type = RFIFOW(fd,2); - int nameid = RFIFOW(fd,4); - int amount = sd->menuskill_val2?sd->menuskill_val2:1; - if( type == 6 && sd->menuskill_id != GN_MIX_COOKING && sd->menuskill_id != GN_S_PHARMACY ) + const struct PACKET_CZ_REQ_MAKINGITEM *p = RFIFOP(fd, 0); + int type = p->type; + int nameid = p->itemId; + int amount = sd->menuskill_val2 ? sd->menuskill_val2 : 1; + if (type == 6 && sd->menuskill_id != GN_MIX_COOKING && sd->menuskill_id != GN_S_PHARMACY) return; if (pc_istrading(sd)) { @@ -11961,8 +11962,8 @@ static void clif_parse_Cooking(int fd, struct map_session_data *sd) clif_menuskill_clear(sd); return; } - if( skill->can_produce_mix(sd,nameid,sd->menuskill_val, amount) ) - skill->produce_mix(sd,(type>1?sd->menuskill_id:0),nameid,0,0,0,amount); + if (skill->can_produce_mix(sd, nameid, sd->menuskill_val, amount)) + skill->produce_mix(sd, (type > 1 ? sd->menuskill_id : 0), nameid, 0, 0, 0, amount); clif_menuskill_clear(sd); } diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 1cf2830f0..29b1de679 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -2160,6 +2160,15 @@ struct PACKET_CZ_REQ_ITEMREPAIR { struct EQUIPSLOTINFO slot; } __attribute__((packed)); +struct PACKET_CZ_REQ_MAKINGITEM { + int16 packetType; + int16 type; +#if PACKETVER_RE_NUM >= 20180704 + uint32 itemId; +#else + uint16 itemId; +#endif +} __attribute__((packed)); #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 |