Core/Objects: Unify Searcher classes into one common implementation
Port From (https://github.com/TrinityCore/TrinityCore/commit/261eb201bf107cef441d9b075e8f23bf0edfbaf0) Port From (https://github.com/TrinityCore/TrinityCore/commit/526b16fea41fb69a302fdebe8a727e175949f04b) Port From (https://github.com/TrinityCore/TrinityCore/commit/8b7dce6521323e788ebf28297ec941a6f9bf876f) Port From (https://github.com/TrinityCore/TrinityCore/commit/5334467f493eb16141f4ad0bce956bc3e19244a0) Port From (https://github.com/TrinityCore/TrinityCore/commit/1e7725c15b149baaf96731231239769e482ec2ed) Port From (https://github.com/TrinityCore/TrinityCore/commit/21712f475383f6f3fae107706f5de5195f75b760)
This commit is contained in:
@@ -747,7 +747,7 @@ namespace Game.Entities
|
||||
var searcher = new CreatureLastSearcher(this, u_check);
|
||||
Cell.VisitGridObjects(this, searcher, radius);
|
||||
|
||||
var creature = searcher.GetTarget();
|
||||
var creature = searcher.GetResult();
|
||||
|
||||
SetNoSearchAssistance(true);
|
||||
|
||||
@@ -2323,7 +2323,7 @@ namespace Game.Entities
|
||||
var searcher = new UnitLastSearcher(this, u_check);
|
||||
Cell.VisitAllObjects(this, searcher, dist);
|
||||
|
||||
return searcher.GetTarget();
|
||||
return searcher.GetResult();
|
||||
}
|
||||
|
||||
// select nearest hostile unit within the given attack distance (i.e. distance is ignored if > than ATTACK_DISTANCE), regardless of threat list.
|
||||
@@ -2340,7 +2340,7 @@ namespace Game.Entities
|
||||
|
||||
Cell.VisitAllObjects(this, searcher, Math.Max(dist, SharedConst.AttackDistance));
|
||||
|
||||
return searcher.GetTarget();
|
||||
return searcher.GetResult();
|
||||
}
|
||||
|
||||
public void SendAIReaction(AiReaction reactionType)
|
||||
@@ -3327,7 +3327,7 @@ namespace Game.Entities
|
||||
var u_check = new NearestHostileUnitInAggroRangeCheck(this, useLOS, ignoreCivilians);
|
||||
var searcher = new UnitSearcher(this, u_check);
|
||||
Cell.VisitGridObjects(this, searcher, SharedConst.MaxAggroRadius);
|
||||
return searcher.GetTarget();
|
||||
return searcher.GetResult();
|
||||
}
|
||||
|
||||
public override float GetNativeObjectScale()
|
||||
@@ -3880,7 +3880,7 @@ namespace Game.Entities
|
||||
base.ClearUpdateMask(remove);
|
||||
}
|
||||
|
||||
class ValuesUpdateForPlayerWithMaskSender : IDoWork<Player>
|
||||
class ValuesUpdateForPlayerWithMaskSender
|
||||
{
|
||||
Creature Owner;
|
||||
ObjectFieldData ObjectMask = new();
|
||||
@@ -3900,6 +3900,8 @@ namespace Game.Entities
|
||||
udata.BuildPacket(out UpdateObject packet);
|
||||
player.SendPacket(packet);
|
||||
}
|
||||
|
||||
public static implicit operator IDoWork<Player>(ValuesUpdateForPlayerWithMaskSender obj) => obj.Invoke;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user