From f84b2ad1c413f7aefc1a9c6f029f6ac67eb8d51d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 25 Feb 2015 23:35:25 +0300 Subject: Add packet for homunculus/mercenary direction. --- src/map/init.c | 1 + src/map/parse.c | 11 +++++++++++ src/map/parse.h | 1 + 3 files changed, 13 insertions(+) (limited to 'src/map') diff --git a/src/map/init.c b/src/map/init.c index 1b1583a..0b38ed7 100644 --- a/src/map/init.c +++ b/src/map/init.c @@ -116,6 +116,7 @@ HPExport void plugin_init (void) addPacket(0xb12, 9, map_parse_pet_dir, hpClif_Parse); addPacket(0xb13, -1, map_parse_homun_say, hpClif_Parse); addPacket(0xb14, 3, map_parse_homun_emote, hpClif_Parse); + addPacket(0xb15, 9, map_parse_homun_dir, 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 cd33f23..b9c9816 100644 --- a/src/map/parse.c +++ b/src/map/parse.c @@ -205,3 +205,14 @@ void map_parse_homun_emote(int fd) else if (sd->hd && homun_alive(sd->hd)) clif->emotion(&sd->hd->bl, RFIFOB(fd, 2)); } + +void map_parse_homun_dir(int fd) +{ + struct map_session_data* sd = (struct map_session_data*)session[fd]->session_data; + if (!sd || !sd->pd) + return; + if (sd->md && sd->md->db) + unit->setdir(&sd->md->bl, RFIFOB(fd, 8)); + else if (sd->hd && homun_alive(sd->hd)) + unit->setdir(&sd->hd->bl, RFIFOB(fd, 8)); +} diff --git a/src/map/parse.h b/src/map/parse.h index 8bd5454..8d137ad 100644 --- a/src/map/parse.h +++ b/src/map/parse.h @@ -15,5 +15,6 @@ void map_parse_pet_move(int fd); void map_parse_pet_dir(int fd); void map_parse_homun_say(int fd); void map_parse_homun_emote(int fd); +void map_parse_homun_dir(int fd); #endif // EVOL_MAP_PARSE -- cgit v1.2.3-60-g2f50