summaryrefslogtreecommitdiff
path: root/src/gui/windows/chatwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows/chatwindow.cpp')
-rw-r--r--src/gui/windows/chatwindow.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index d6bca3781..992932084 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -1479,9 +1479,17 @@ bool ChatWindow::resortChatLog(std::string line, Own own,
const size_t idx = line.find(": \302\202");
if (idx == idx2)
{
- // ignore special message formats.
if (line.find(": \302\202\302") != std::string::npos)
+ {
+ if (line.find(": \302\202\302e") != std::string::npos)
+ {
+ const std::string nick = line.substr(0, idx2 - 1);
+ line = line.substr(idx2 + 6);
+ localPetEmote(nick, atoi(line.c_str()));
+ }
+ // ignore other special message formats.
return false;
+ }
// pet talk message detected
if (line.find(": \302\202\303 ") != std::string::npos)
@@ -1587,6 +1595,18 @@ void ChatWindow::localPetSay(const std::string &nick, const std::string &text)
}
}
+void ChatWindow::localPetEmote(const std::string &nick, const uint8_t emoteId)
+{
+ Being *const being = actorManager->findBeingByName(
+ nick, ActorSprite::PLAYER);
+ if (being)
+ {
+ Being *const pet = being->getPet();
+ if (pet)
+ pet->setEmote(emoteId, 0);
+ }
+}
+
void ChatWindow::initTradeFilter()
{
const std::string tradeListName = client->getServerConfigDirectory()