diff --git a/src/monster.cpp b/src/monster.cpp index d052d71..d50b0fa 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -744,21 +744,20 @@ void Monster::setIdle(bool idle) void Monster::updateIdleStatus() { - bool idle = false; + bool idle = true; if (!isSummon()) { - if (conditions.empty() && targetList.empty()) { - idle = true; - } else if (!conditions.empty()) { - bool hasAggressiveCondition = false; + if (!targetList.empty()) { + // visible target + idle = false; + } else { for (Condition* condition : conditions) { if (condition->getType() >= CONDITION_ENERGY && condition->getType() <= CONDITION_ENERGY) { - hasAggressiveCondition = true; + // monsters with aggressive conditions never become idle + idle = false; break; } } - - idle = !hasAggressiveCondition; } } diff --git a/src/player.cpp b/src/player.cpp index c57a079..db34103 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -549,6 +549,7 @@ bool Player::canSeeCreature(const Creature* creature) const if (!creature->getPlayer() && !canSeeInvisibility() && creature->isInvisible()) { return false; } + return true; } diff --git a/src/protocolgame.cpp b/src/protocolgame.cpp index 48907fc..b6f604f 100644 --- a/src/protocolgame.cpp +++ b/src/protocolgame.cpp @@ -1786,7 +1786,7 @@ void ProtocolGame::AddCreature(NetworkMessage& msg, const Creature* creature, bo msg.addByte(std::ceil((static_cast(creature->getHealth()) / std::max(creature->getMaxHealth(), 1)) * 100)); msg.addByte(creature->getDirection()); - if (!creature->isInGhostMode() && !creature->isInvisible()) { + if (!creature->isInvisible() || !otherPlayer && player->canSeeInvisibility()) { AddOutfit(msg, creature->getCurrentOutfit()); } else { static Outfit_t outfit;