From 0044688420926f0e336973c4feb50932bfab46ce Mon Sep 17 00:00:00 2001 From: Alejandro Mujica Date: Sat, 13 Apr 2019 16:16:30 -0400 Subject: [PATCH] Monster Idle Bug fix Should fix #33 Credits [monsters idle bug fix official TFS](https://github.com/otland/forgottenserver/pull/2545]) --- src/monster.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/monster.cpp b/src/monster.cpp index 9826383..d052d71 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -746,9 +746,19 @@ void Monster::updateIdleStatus() { bool idle = false; - if (conditions.empty()) { - if (!isSummon() && targetList.empty()) { + if (!isSummon()) { + if (conditions.empty() && targetList.empty()) { idle = true; + } else if (!conditions.empty()) { + bool hasAggressiveCondition = false; + for (Condition* condition : conditions) { + if (condition->getType() >= CONDITION_ENERGY && condition->getType() <= CONDITION_ENERGY) { + hasAggressiveCondition = true; + break; + } + } + + idle = !hasAggressiveCondition; } }