From a11ad3c7f56cf9fbfbcb9edc041ff3a26fad7542 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 25 Feb 2015 19:55:28 +0300 Subject: Add packet for homunculus/mercenary emote. --- src/map/parse.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/map/parse.c') diff --git a/src/map/parse.c b/src/map/parse.c index ba73516..cd33f23 100644 --- a/src/map/parse.c +++ b/src/map/parse.c @@ -125,7 +125,7 @@ void map_parse_pet_say(int fd) void map_parse_pet_emote(int fd) { struct map_session_data* sd = (struct map_session_data*)session[fd]->session_data; - if (!sd) + if (!sd || !sd->pd) return; const time_t t = time(NULL); if (sd->emotionlasttime + 1 >= t) @@ -135,7 +135,7 @@ void map_parse_pet_emote(int fd) } sd->emotionlasttime = t; - send_pet_emote(sd, RFIFOB(fd, 2)); + clif->emotion(&sd->pd->bl, RFIFOB(fd, 2)); } void map_parse_set_status(int fd) @@ -186,3 +186,22 @@ void map_parse_homun_say(int fd) else if (sd->hd && homun_alive(sd->hd)) send_slave_say(sd, &sd->hd->bl, sd->hd->homunculus.name, message); } + +void map_parse_homun_emote(int fd) +{ + struct map_session_data* sd = (struct map_session_data*)session[fd]->session_data; + if (!sd) + return; + const time_t t = time(NULL); + if (sd->emotionlasttime + 1 >= t) + { // not more than 1 per second + sd->emotionlasttime = t; + return; + } + + sd->emotionlasttime = t; + if (sd->md && sd->md->db) + clif->emotion(&sd->md->bl, RFIFOB(fd, 2)); + else if (sd->hd && homun_alive(sd->hd)) + clif->emotion(&sd->hd->bl, RFIFOB(fd, 2)); +} -- cgit v1.2.3-70-g09d2