mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 13:46:24 +00:00
fix(Core/AI): validate stored targets (#12489)
Co-authored-by: Meji <meji46@users.noreply.github.com> Co-authored-by: Ariel Silva <ariel-@users.noreply.github.com> Co-authored-by: Shauren <shauren.trinity@gmail.com> Co-authored-by: Meji <meji46@users.noreply.github.com> Co-authored-by: Ariel Silva <ariel-@users.noreply.github.com> Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
@@ -80,7 +80,7 @@ public:
|
||||
{
|
||||
// insert or replace
|
||||
_storedTargets.erase(id);
|
||||
_storedTargets.emplace(id, ObjectGuidVector(GetBaseObject(), targets));
|
||||
_storedTargets.emplace(id, ObjectGuidVector(targets));
|
||||
}
|
||||
|
||||
bool IsSmart(Creature* c = nullptr)
|
||||
@@ -112,11 +112,11 @@ public:
|
||||
return smart;
|
||||
}
|
||||
|
||||
ObjectVector const* GetStoredTargetVector(uint32 id) const
|
||||
ObjectVector const* GetStoredTargetVector(uint32 id, WorldObject const& ref) const
|
||||
{
|
||||
auto itr = _storedTargets.find(id);
|
||||
if (itr != _storedTargets.end())
|
||||
return itr->second.GetObjectVector();
|
||||
return itr->second.GetObjectVector(ref);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user