From 9ecd36f5dd308aac9bfd673474774bd3a727df53 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 22 Feb 2015 14:50:44 +0300 Subject: Allow move pet by packet from client. --- src/map/init.c | 1 + src/map/parse.c | 15 +++++++++++++++ src/map/parse.h | 1 + 3 files changed, 17 insertions(+) (limited to 'src/map') diff --git a/src/map/init.c b/src/map/init.c index 3c736f9..0253ffa 100644 --- a/src/map/init.c +++ b/src/map/init.c @@ -111,6 +111,7 @@ HPExport void plugin_init (void) addPacket(0xb0d, 3, map_parse_pet_emote, hpClif_Parse); addPacket(0xb0e, 4, map_parse_set_status, hpClif_Parse); addPacket(0xb0f, 2, map_parse_get_online_list, hpClif_Parse); + addPacket(0xb11, 10, map_parse_pet_move, hpClif_Parse); addHookPre("pc->readparam", epc_readparam_pre); addHookPre("pc->setregistry", epc_setregistry); diff --git a/src/map/parse.c b/src/map/parse.c index 3cef1f9..0a7faf1 100644 --- a/src/map/parse.c +++ b/src/map/parse.c @@ -13,6 +13,8 @@ #include "../../../map/channel.h" #include "../../../map/clif.h" #include "../../../map/pc.h" +#include "../../../map/pet.h" +#include "../../../map/unit.h" #include "map/parse.h" #include "map/send.h" @@ -136,3 +138,16 @@ void map_parse_get_online_list(int fd) { emap_online_list(fd); } + +void map_parse_pet_move(int fd) +{ + struct map_session_data* sd = (struct map_session_data*)session[fd]->session_data; + if (!sd || !sd->pd) + return; + short x = RFIFOW(fd, 6); + short y = RFIFOW(fd, 8); + + struct block_list *pdBl = &sd->pd->bl; + if (map->getcell(pdBl->m, x, y, CELL_CHKPASS)) + unit->walktoxy(pdBl, x, y, 0); +} diff --git a/src/map/parse.h b/src/map/parse.h index f1488dd..3ad9f6c 100644 --- a/src/map/parse.h +++ b/src/map/parse.h @@ -11,5 +11,6 @@ void map_parse_pet_say(int fd); void map_parse_pet_emote(int fd); void map_parse_set_status(int fd); void map_parse_get_online_list(int fd); +void map_parse_pet_move(int fd); #endif // EVOL_MAP_PARSE -- cgit v1.2.3-60-g2f50