From df0a324108cd8b6ee7ac984700efed80044ed7c3 Mon Sep 17 00:00:00 2001 From: Haru Date: Tue, 3 Sep 2013 05:42:43 +0200 Subject: Fixed several packet errors with pre-renewal clients from 2006-2008 Thanks to Beret for reporting the issues, Ind for his great help with research, suggestions and the necessary tools to fix this. Signed-off-by: Haru --- src/map/clif.c | 6 +++++- src/map/packets_struct.h | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src/map') diff --git a/src/map/clif.c b/src/map/clif.c index fad10be92..306a83082 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -873,7 +873,9 @@ void clif_set_unit_idle2(struct block_list* bl, struct map_session_data *tsd, en sd = BL_CAST(BL_PC, bl); p.PacketType = idle_unit2Type; +#if PACKETVER >= 20071106 p.objecttype = clif_bl_type(bl); +#endif p.GID = bl->id; p.speed = iStatus->get_speed(bl); p.bodyState = (sc) ? sc->opt1 : 0; @@ -1005,7 +1007,9 @@ void clif_spawn_unit2(struct block_list* bl, enum send_target target) { sd = BL_CAST(BL_PC, bl); p.PacketType = spawn_unit2Type; +#if PACKETVER >= 20071106 p.objecttype = clif_bl_type(bl); +#endif p.GID = bl->id; p.speed = iStatus->get_speed(bl); p.bodyState = (sc) ? sc->opt1 : 0; @@ -1133,7 +1137,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd, #if PACKETVER >= 20091103 p.PacketLength = sizeof(p); #endif -#if PACKETVER > 7 +#if PACKETVER >= 20071106 p.objecttype = clif_bl_type(bl); #endif p.GID = bl->id; diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 053cd96b8..0e04756ec 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -180,7 +180,9 @@ struct packet_dropflooritem { #if PACKETVER < 20091103 struct packet_idle_unit2 { short PacketType; +#if PACKETVER >= 20071106 unsigned char objecttype; +#endif unsigned int GID; short speed; short bodyState; @@ -210,7 +212,9 @@ struct packet_idle_unit2 { } __attribute__((packed)); struct packet_spawn_unit2 { short PacketType; +#if PACKETVER >= 20071106 unsigned char objecttype; +#endif unsigned int GID; short speed; short bodyState; @@ -297,7 +301,7 @@ struct packet_unit_walking { #if PACKETVER >= 20091103 short PacketLength; #endif -#if PACKETVER > 7 +#if PACKETVER > 20071106 unsigned char objecttype; #endif unsigned int GID; -- cgit v1.2.3-70-g09d2