summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-22 14:50:44 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-22 14:50:44 +0300
commit9ecd36f5dd308aac9bfd673474774bd3a727df53 (patch)
treebcfa2d7fc7075ed0763adfcc4f76802a506a223d /src
parent7dfeba7f6f050e3f624291a97c7a82de57c54980 (diff)
downloadplugin-9ecd36f5dd308aac9bfd673474774bd3a727df53.tar.gz
plugin-9ecd36f5dd308aac9bfd673474774bd3a727df53.tar.bz2
plugin-9ecd36f5dd308aac9bfd673474774bd3a727df53.tar.xz
plugin-9ecd36f5dd308aac9bfd673474774bd3a727df53.zip
Allow move pet by packet from client.
Diffstat (limited to 'src')
-rw-r--r--src/map/init.c1
-rw-r--r--src/map/parse.c15
-rw-r--r--src/map/parse.h1
3 files changed, 17 insertions, 0 deletions
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