mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-05-02 18:49:21 +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:
parent
94399f1a79
commit
76c925111d
@ -744,21 +744,20 @@ void Monster::setIdle(bool idle)
|
|||||||
|
|
||||||
void Monster::updateIdleStatus()
|
void Monster::updateIdleStatus()
|
||||||
{
|
{
|
||||||
bool idle = false;
|
bool idle = true;
|
||||||
|
|
||||||
if (!isSummon()) {
|
if (!isSummon()) {
|
||||||
if (conditions.empty() && targetList.empty()) {
|
if (!targetList.empty()) {
|
||||||
idle = true;
|
// visible target
|
||||||
} else if (!conditions.empty()) {
|
idle = false;
|
||||||
bool hasAggressiveCondition = false;
|
} else {
|
||||||
for (Condition* condition : conditions) {
|
for (Condition* condition : conditions) {
|
||||||
if (condition->getType() >= CONDITION_ENERGY && condition->getType() <= CONDITION_ENERGY) {
|
if (condition->getType() >= CONDITION_ENERGY && condition->getType() <= CONDITION_ENERGY) {
|
||||||
hasAggressiveCondition = true;
|
// monsters with aggressive conditions never become idle
|
||||||
|
idle = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
idle = !hasAggressiveCondition;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -549,6 +549,7 @@ bool Player::canSeeCreature(const Creature* creature) const
|
|||||||
if (!creature->getPlayer() && !canSeeInvisibility() && creature->isInvisible()) {
|
if (!creature->getPlayer() && !canSeeInvisibility() && creature->isInvisible()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
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(std::ceil((static_cast<double>(creature->getHealth()) / std::max<int32_t>(creature->getMaxHealth(), 1)) * 100));
|
||||||
msg.addByte(creature->getDirection());
|
msg.addByte(creature->getDirection());
|
||||||
|
|
||||||
if (!creature->isInGhostMode() && !creature->isInvisible()) {
|
if (!creature->isInvisible() || !otherPlayer && player->canSeeInvisibility()) {
|
||||||
AddOutfit(msg, creature->getCurrentOutfit());
|
AddOutfit(msg, creature->getCurrentOutfit());
|
||||||
} else {
|
} else {
|
||||||
static Outfit_t outfit;
|
static Outfit_t outfit;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user