Skip to content

Commit edcf9a8

Browse files
committed
Adjusted packet size for weapon and shield for older clients to int16 rather the modern int32.
Signed-off-by: Lorenzo Buitizon <the.keikun@gmail.com>
1 parent c1fa550 commit edcf9a8

2 files changed

Lines changed: 16 additions & 25 deletions

File tree

src/map/clif.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,9 +1142,7 @@ static void clif_set_unit_idle(struct block_list *bl, struct map_session_data *t
11421142
p.head = vd->hair_style;
11431143
p.weapon = vd->weapon;
11441144
p.accessory = vd->head_bottom;
1145-
#if PACKETVER < 7 || PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
11461145
p.shield = vd->shield;
1147-
#endif
11481146
p.accessory2 = vd->head_top;
11491147
p.accessory3 = vd->head_mid;
11501148
if (bl->type == BL_NPC && vd->class == FLAG_CLASS) {
@@ -1301,9 +1299,7 @@ static void clif_spawn_unit(struct block_list *bl, enum send_target target)
13011299
p.head = vd->hair_style;
13021300
p.weapon = vd->weapon;
13031301
p.accessory = vd->head_bottom;
1304-
#if PACKETVER < 7 || PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
13051302
p.shield = vd->shield;
1306-
#endif
13071303
p.accessory2 = vd->head_top;
13081304
p.accessory3 = vd->head_mid;
13091305
if (bl->type == BL_NPC && vd->class == FLAG_CLASS) {
@@ -1411,9 +1407,7 @@ static void clif_set_unit_walking(struct block_list *bl, struct map_session_data
14111407
p.weapon = vd->weapon;
14121408
p.accessory = vd->head_bottom;
14131409
p.moveStartTime = (unsigned int)timer->gettick();
1414-
#if PACKETVER < 7 || PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
14151410
p.shield = vd->shield;
1416-
#endif
14171411
p.accessory2 = vd->head_top;
14181412
p.accessory3 = vd->head_mid;
14191413
p.headpalette = vd->hair_color;

src/map/packets_struct.h

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ enum packet_headers {
141141
bgqueue_battlebeginsType = 0x8df,
142142
notify_bounditemType = 0x2d3,
143143
#if PACKETVER < 20110718
144-
skill_entryType = 0x11f,
144+
skill_entryType = zx11f,
145145
#elif PACKETVER < 20121212
146146
skill_entryType = 0x8c7,
147147
#elif PACKETVER < 20130731
@@ -727,18 +727,17 @@ struct packet_spawn_unit {
727727
#endif
728728
int16 job;
729729
uint16 head;
730-
#if PACKETVER < 7
731-
uint16 weapon;
732-
#else
730+
#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
733731
uint32 weapon;
732+
else
733+
uint16 weapon;
734734
#endif
735735
#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
736736
uint32 shield;
737-
#endif
738-
uint16 accessory;
739-
#if PACKETVER < 7
737+
else
740738
uint16 shield;
741739
#endif
740+
uint16 accessory;
742741
uint16 accessory2;
743742
uint16 accessory3;
744743
int16 headpalette;
@@ -800,19 +799,18 @@ struct packet_unit_walking {
800799
#endif
801800
int16 job;
802801
uint16 head;
803-
#if PACKETVER < 7
804-
uint16 weapon;
805-
#else
802+
#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
806803
uint32 weapon;
804+
else
805+
uint16 weapon;
807806
#endif
808807
#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
809808
uint32 shield;
809+
else
810+
uint16 shield;
810811
#endif
811812
uint16 accessory;
812813
uint32 moveStartTime;
813-
#if PACKETVER < 7
814-
uint16 shield;
815-
#endif
816814
uint16 accessory2;
817815
uint16 accessory3;
818816
int16 headpalette;
@@ -872,18 +870,17 @@ struct packet_idle_unit {
872870
#endif
873871
int16 job;
874872
uint16 head;
875-
#if PACKETVER < 7
876-
uint16 weapon;
877-
#else
873+
#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
878874
uint32 weapon;
875+
else
876+
uint16 weapon;
879877
#endif
880878
#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
881879
uint32 shield;
882-
#endif
883-
uint16 accessory;
884-
#if PACKETVER < 7
880+
else
885881
uint16 shield;
886882
#endif
883+
uint16 accessory;
887884
uint16 accessory2;
888885
uint16 accessory3;
889886
int16 headpalette;

0 commit comments

Comments
 (0)