summaryrefslogtreecommitdiff
path: root/src/net/tmwa/pethandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-03-07 12:28:38 +0300
committerAndrei Karas <akaras@inbox.ru>2014-03-07 12:28:38 +0300
commita7258e25d06f90b10dee8281a65d239c89e5094c (patch)
treeec7ff20bb141da153453493f03fea3744537b19f /src/net/tmwa/pethandler.cpp
parent7bbd2004db69dcf456a606a350d315e2fefa7d4f (diff)
downloadplus-a7258e25d06f90b10dee8281a65d239c89e5094c.tar.gz
plus-a7258e25d06f90b10dee8281a65d239c89e5094c.tar.bz2
plus-a7258e25d06f90b10dee8281a65d239c89e5094c.tar.xz
plus-a7258e25d06f90b10dee8281a65d239c89e5094c.zip
fix emote command in crazy moves A.
Diffstat (limited to 'src/net/tmwa/pethandler.cpp')
-rw-r--r--src/net/tmwa/pethandler.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/net/tmwa/pethandler.cpp b/src/net/tmwa/pethandler.cpp
index 3293b7edd..77317a077 100644
--- a/src/net/tmwa/pethandler.cpp
+++ b/src/net/tmwa/pethandler.cpp
@@ -34,7 +34,8 @@ namespace TmwAthena
{
PetHandler::PetHandler() :
- MessageHandler()
+ MessageHandler(),
+ mRandCounter(1000)
{
static const uint16_t _messages[] =
{
@@ -63,10 +64,14 @@ void PetHandler::spawn(const Being *const being A_UNUSED,
{
}
-void PetHandler::emote(const uint8_t emoteId, const int petId A_UNUSED) const
+void PetHandler::emote(const uint8_t emoteId, const int petId A_UNUSED)
{
- Net::getChatHandler()->talk("\302\202\302e" + toString(
- static_cast<int>(emoteId)), GENERAL_CHANNEL);
+ mRandCounter ++;
+ if (mRandCounter > 10000)
+ mRandCounter = 1000;
+
+ Net::getChatHandler()->talk(strprintf("\302\202\302e%dz%d",
+ static_cast<int>(emoteId), mRandCounter), GENERAL_CHANNEL);
}
} // namespace TmwAthena