From cc939bec81af517d0e430064d872e3388116d16e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 19 Aug 2015 01:52:50 +0300 Subject: Add workaround for npc talk action for avoid packets limit. --- src/being/being.cpp | 14 ++++++++++++-- 1 file 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, -- cgit v1.2.3-70-g09d2