Core/Objects: Units possessing another ones must use the detection of the latter
Port From (https://github.com/TrinityCore/TrinityCore/commit/74645553be9213e366a62c6967db1d9933f3d7a7)
This commit is contained in:
@@ -1243,13 +1243,23 @@ namespace Game.Entities
|
||||
{
|
||||
WorldObject seer = this;
|
||||
|
||||
// If a unit is possessing another one, it uses the detection of the latter
|
||||
// Pets don't have detection, they use the detection of their masters
|
||||
Unit thisUnit = ToUnit();
|
||||
if (thisUnit != null)
|
||||
{
|
||||
Unit controller = thisUnit.GetCharmerOrOwner();
|
||||
if (controller != null)
|
||||
seer = controller;
|
||||
if (thisUnit.IsPossessing())
|
||||
{
|
||||
Unit charmed = thisUnit.GetCharmed();
|
||||
if (charmed != null)
|
||||
seer = charmed;
|
||||
}
|
||||
else
|
||||
{
|
||||
Unit controller = thisUnit.GetCharmerOrOwner();
|
||||
if (controller != null)
|
||||
seer = controller;
|
||||
}
|
||||
}
|
||||
|
||||
if (obj.IsAlwaysDetectableFor(seer))
|
||||
|
||||
Reference in New Issue
Block a user