feat(Core/Conditions): Implement CONDITION_SOURCE_CREATURE_VISIBILITY (#10208)
This commit is contained in:
parent
0f2c092df7
commit
fe4899202d
2 changed files with 18 additions and 3 deletions
|
|
@ -1908,8 +1908,22 @@ bool WorldObject::CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
|
|||
|
||||
// Creature scripts
|
||||
if (Creature const* cObj = obj->ToCreature())
|
||||
if (cObj->IsAIEnabled && this->ToPlayer() && !cObj->AI()->CanBeSeen(this->ToPlayer()))
|
||||
return false;
|
||||
{
|
||||
if (Player const* player = this->ToPlayer())
|
||||
{
|
||||
if (cObj->IsAIEnabled && !cObj->AI()->CanBeSeen(player))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_CREATURE_VISIBILITY, cObj->GetEntry());
|
||||
|
||||
if (!sConditionMgr->IsObjectMeetToConditions((WorldObject*)this, conditions))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Gameobject scripts
|
||||
if (GameObject const* goObj = obj->ToGameObject())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue