Game/AI: Implement new targettype SMART_TARGET_CLOSEST_UNSPAWNED_GAMEOBJECT

Port From (https://github.com/TrinityCore/TrinityCore/commit/db825c3221de16cdb757711781318d76b414213f)
This commit is contained in:
hondacrx
2022-02-18 13:35:32 -05:00
parent ed5648d8ac
commit 8126e7c6e1
6 changed files with 50 additions and 8 deletions
@@ -1540,6 +1540,15 @@ namespace Game.Entities
return searcher.GetTarget();
}
public GameObject FindNearestUnspawnedGameObject(uint entry, float range)
{
NearestUnspawnedGameObjectEntryInObjectRangeCheck checker = new(this, entry, range);
GameObjectLastSearcher searcher = new(this, checker);
Cell.VisitGridObjects(this, searcher, range);
return searcher.GetTarget();
}
public GameObject FindNearestGameObjectOfType(GameObjectTypes type, float range)
{
var checker = new NearestGameObjectTypeInObjectRangeCheck(this, type, range);