diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-08-19 01:52:50 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-08-19 01:52:50 +0300 |
commit | cc939bec81af517d0e430064d872e3388116d16e (patch) | |
tree | 5a79d8db36b9be8c1a385828c2eb9796725fdc69 /src | |
parent | a1b0a12f03f56b0a60f9d4f6e28f5714200aee96 (diff) | |
download | manaverse-cc939bec81af517d0e430064d872e3388116d16e.tar.gz manaverse-cc939bec81af517d0e430064d872e3388116d16e.tar.bz2 manaverse-cc939bec81af517d0e430064d872e3388116d16e.tar.xz manaverse-cc939bec81af517d0e430064d872e3388116d16e.zip |
Add workaround for npc talk action for avoid packets limit.
Diffstat (limited to 'src')
-rw-r--r-- | src/being/being.cpp | 14 |
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, |