summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-08-19 01:52:50 +0300
committerAndrei Karas <akaras@inbox.ru>2015-08-19 01:52:50 +0300
commitcc939bec81af517d0e430064d872e3388116d16e (patch)
tree5a79d8db36b9be8c1a385828c2eb9796725fdc69
parenta1b0a12f03f56b0a60f9d4f6e28f5714200aee96 (diff)
downloadmanaplus-cc939bec81af517d0e430064d872e3388116d16e.tar.gz
manaplus-cc939bec81af517d0e430064d872e3388116d16e.tar.bz2
manaplus-cc939bec81af517d0e430064d872e3388116d16e.tar.xz
manaplus-cc939bec81af517d0e430064d872e3388116d16e.zip
Add workaround for npc talk action for avoid packets limit.
-rw-r--r--src/being/being.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index ca5d7fd1a..8413916fe 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -2666,11 +2666,21 @@ void Being::setGM(const bool gm)
void Being::talkTo() const
{
+ if (!npcHandler)
+ return;
+
if (!PacketLimiter::limitPackets(PacketType::PACKET_NPC_TALK))
+ {
+ // using workaround...
+ if (playerHandler &&
+ PacketLimiter::limitPackets(PacketType::PACKET_ATTACK))
+ {
+ playerHandler->attack(mId, Keep_false);
+ }
return;
+ }
- if (npcHandler)
- npcHandler->talk(mId);
+ npcHandler->talk(mId);
}
void Being::draw(Graphics *const graphics,