diff --git a/src/map/clif.cpp b/src/map/clif.cpp index e76658f17d..45bc8db2e6 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -8871,13 +8871,14 @@ static void clif_guild_positioninfolist(map_session_data& sd){ for(size_t i=0;iguild.position[i]; + PACKET_ZC_POSITION_INFO_sub& position = p->posInfo[i]; - p->posInfo[i].positionID = i; - p->posInfo[i].right = gp.mode; - p->posInfo[i].ranking = i; - p->posInfo[i].payRate = gp.exp_mode; + position.positionID = static_cast( i ); + position.right = gp.mode; + position.ranking = static_cast( i ); + position.payRate = gp.exp_mode; - p->PacketLength += static_castPacketLength)>( sizeof( p->posInfo[0] ) ); + p->PacketLength += static_castPacketLength)>( sizeof( position ) ); } clif_send(p,p->PacketLength,&sd.bl,SELF); diff --git a/src/map/packets_struct.hpp b/src/map/packets_struct.hpp index bda5c305d9..4f466fb0f0 100644 --- a/src/map/packets_struct.hpp +++ b/src/map/packets_struct.hpp @@ -4998,15 +4998,17 @@ struct PACKET_ZC_POSITION_ID_NAME_INFO { } __attribute__((packed)); DEFINE_PACKET_HEADER(ZC_POSITION_ID_NAME_INFO, 0x0166); +struct PACKET_ZC_POSITION_INFO_sub { + int positionID; + int right; + int ranking; + int payRate; +} __attribute__((packed)); + struct PACKET_ZC_POSITION_INFO { int16 PacketType; int16 PacketLength; - struct { - int positionID; - int right; - int ranking; - int payRate; - } posInfo[MAX_GUILDPOSITION]; + struct PACKET_ZC_POSITION_INFO_sub posInfo[]; } __attribute__((packed)); DEFINE_PACKET_HEADER(ZC_POSITION_INFO, 0x0160);