From a7258e25d06f90b10dee8281a65d239c89e5094c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 7 Mar 2014 12:28:38 +0300 Subject: fix emote command in crazy moves A. --- src/net/tmwa/pethandler.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/net/tmwa/pethandler.cpp') 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(emoteId)), GENERAL_CHANNEL); + mRandCounter ++; + if (mRandCounter > 10000) + mRandCounter = 1000; + + Net::getChatHandler()->talk(strprintf("\302\202\302e%dz%d", + static_cast(emoteId), mRandCounter), GENERAL_CHANNEL); } } // namespace TmwAthena -- cgit v1.2.3-60-g2f50