mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-13 22:34:53 +02:00
Important bug fixes
Fixed an issue that would not let invisible creatures such as the Stalker to become idle, hence never returning visible. Fixed an issue with gamemasters not being able to see invisible creatures that were out of their screen.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -549,6 +549,7 @@ bool Player::canSeeCreature(const Creature* creature) const
|
||||
if (!creature->getPlayer() && !canSeeInvisibility() && creature->isInvisible()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -1786,7 +1786,7 @@ void ProtocolGame::AddCreature(NetworkMessage& msg, const Creature* creature, bo
|
||||
msg.addByte(std::ceil((static_cast<double>(creature->getHealth()) / std::max<int32_t>(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;
|
||||
|
Reference in New Issue
Block a user