summaryrefslogtreecommitdiff
path: root/src/map/parse.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-25 19:55:28 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-25 19:55:28 +0300
commita11ad3c7f56cf9fbfbcb9edc041ff3a26fad7542 (patch)
tree74427d0753dca50192caba7db7ecc3d40ad5b768 /src/map/parse.c
parentb35860a736d42d0320e9a7afbf9d56b7b95214f9 (diff)
downloadplugin-a11ad3c7f56cf9fbfbcb9edc041ff3a26fad7542.tar.gz
plugin-a11ad3c7f56cf9fbfbcb9edc041ff3a26fad7542.tar.bz2
plugin-a11ad3c7f56cf9fbfbcb9edc041ff3a26fad7542.tar.xz
plugin-a11ad3c7f56cf9fbfbcb9edc041ff3a26fad7542.zip
Add packet for homunculus/mercenary emote.
Diffstat (limited to 'src/map/parse.c')
-rw-r--r--src/map/parse.c23
1 files changed, 21 insertions, 2 deletions
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));
+}