Converted CZ_REQUEST_MOVENPC to struct

This commit is contained in:
Lemongrass3110 2024-09-18 10:39:27 +02:00
parent b07fcd3c7c
commit d85c709ccb
3 changed files with 16 additions and 8 deletions

View File

@ -15459,19 +15459,19 @@ void clif_parse_HomMoveToMaster(int fd, map_session_data *sd){
} }
/// Request to move homunculus/mercenary (CZ_REQUEST_MOVENPC). /// Request to move homunculus/mercenary.
/// 0232 <id>.L <position data>.3B /// 0232 <id>.L <position data>.3B (CZ_REQUEST_MOVENPC)
void clif_parse_HomMoveTo(int fd, map_session_data *sd){ void clif_parse_HomMoveTo(int fd, map_session_data *sd){
struct s_packet_db* info = &packet_db[RFIFOW(fd,0)]; #if PACKETVER >= 20050425
int id = RFIFOL(fd,info->pos[0]); // Mercenary or Homunculus const PACKET_CZ_REQUEST_MOVENPC* p = reinterpret_cast<const PACKET_CZ_REQUEST_MOVENPC*>( RFIFOP( fd, 0 ) );
struct block_list *bl = nullptr; struct block_list *bl = nullptr;
short x, y; short x, y;
RFIFOPOS(fd, info->pos[1], &x, &y, nullptr); RBUFPOS( p->PosDir, 0, &x, &y, nullptr );
if( sd->md && sd->md->bl.id == id ) if( sd->md && sd->md->bl.id == p->GID )
bl = &sd->md->bl; // Moving Mercenary bl = &sd->md->bl; // Moving Mercenary
else if( hom_is_active(sd->hd) && sd->hd->bl.id == id ) else if( hom_is_active(sd->hd) && sd->hd->bl.id == p->GID )
bl = &sd->hd->bl; // Moving Homunculus bl = &sd->hd->bl; // Moving Homunculus
else else
return; return;
@ -15480,6 +15480,7 @@ void clif_parse_HomMoveTo(int fd, map_session_data *sd){
return; return;
unit_walktoxy(bl, x, y, 4); unit_walktoxy(bl, x, y, 4);
#endif
} }

View File

@ -563,7 +563,7 @@
// 2005-04-25aSakexe // 2005-04-25aSakexe
#if PACKETVER >= 20050425 #if PACKETVER >= 20050425
parseable_packet(0x022d,5,clif_parse_HomMenu,2,4); parseable_packet(0x022d,5,clif_parse_HomMenu,2,4);
parseable_packet(0x0232,9,clif_parse_HomMoveTo,2,6); parseable_packet( HEADER_CZ_REQUEST_MOVENPC, sizeof( PACKET_CZ_REQUEST_MOVENPC ), clif_parse_HomMoveTo, 0 );
parseable_packet(0x0233,11,clif_parse_HomAttack,2,6,10); parseable_packet(0x0233,11,clif_parse_HomAttack,2,6,10);
parseable_packet(0x0234,6,clif_parse_HomMoveToMaster,2); parseable_packet(0x0234,6,clif_parse_HomMoveToMaster,2);
#endif #endif

View File

@ -1362,6 +1362,13 @@ struct PACKET_ZC_NOTIFY_ACT{
DEFINE_PACKET_HEADER(ZC_NOTIFY_ACT, 0x8a); DEFINE_PACKET_HEADER(ZC_NOTIFY_ACT, 0x8a);
#endif #endif
struct PACKET_CZ_REQUEST_MOVENPC{
int16 packetType;
uint32 GID;
uint8 PosDir[3];
} __attribute__((packed));
DEFINE_PACKET_HEADER(CZ_REQUEST_MOVENPC, 0x232);
// NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
#if !defined( sun ) && ( !defined( __NETBSD__ ) || __NetBSD_Version__ >= 600000000 ) #if !defined( sun ) && ( !defined( __NETBSD__ ) || __NetBSD_Version__ >= 600000000 )
#pragma pack( pop ) #pragma pack( pop )