summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/windows/chatwindow.cpp25
-rw-r--r--src/gui/windows/chatwindow.h3
2 files changed, 28 insertions, 0 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index 524256dd4..7f6c2e731 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -1513,6 +1513,15 @@ bool ChatWindow::resortChatLog(std::string line,
localPetEmote(nick, static_cast<uint8_t>(
atoi(line.c_str())));
}
+ else if (line.find(": \302\202\302m") != std::string::npos)
+ {
+ const std::string nick = line.substr(0, idx2 - 1);
+ line = line.substr(idx2 + 6);
+ int x = 0;
+ int y = 0;
+ if (parse2Int(line, x, y))
+ localPetMove(nick, x, y);
+ }
// ignore other special message formats.
return false;
}
@@ -1670,6 +1679,22 @@ void ChatWindow::localPetEmote(const std::string &nick, const uint8_t emoteId)
}
}
+void ChatWindow::localPetMove(const std::string &nick,
+ const int x, const int y)
+{
+ Being *const being = actorManager->findBeingByName(
+ nick, ActorType::Player);
+ if (being)
+ {
+ Being *const pet = being->getFirstPet();
+ if (pet)
+ {
+ pet->setDestination(x, y);
+ pet->disablePetAi();
+ }
+ }
+}
+
void ChatWindow::initTradeFilter()
{
const std::string tradeListName = settings.serverConfigDir
diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h
index a6bf15384..1b22ee05f 100644
--- a/src/gui/windows/chatwindow.h
+++ b/src/gui/windows/chatwindow.h
@@ -297,6 +297,9 @@ class ChatWindow final : public Window,
static void localPetEmote(const std::string &nick,
const uint8_t emoteId);
+ static void localPetMove(const std::string &nick,
+ const int x, const int y);
+
void postConnection();
#ifdef USE_PROFILER