mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-16 05:55:07 +00:00
Merge branch 'master' into Playerbot
# Conflicts: # src/server/game/Entities/Creature/Creature.cpp # src/server/game/Entities/Creature/Creature.h # src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
This commit is contained in:
@@ -261,12 +261,18 @@ HostileReference* ThreatContainer::getReferenceByTarget(Unit* victim) const
|
||||
if (!victim)
|
||||
return nullptr;
|
||||
|
||||
ObjectGuid const guid = victim->GetGUID();
|
||||
return getReferenceByTarget(victim->GetGUID());
|
||||
}
|
||||
|
||||
HostileReference* ThreatContainer::getReferenceByTarget(ObjectGuid const& guid) const
|
||||
{
|
||||
for (ThreatContainer::StorageType::const_iterator i = iThreatList.begin(); i != iThreatList.end(); ++i)
|
||||
{
|
||||
HostileReference* ref = (*i);
|
||||
if (ref && ref->getUnitGuid() == guid)
|
||||
{
|
||||
return ref;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
||||
@@ -164,6 +164,7 @@ public:
|
||||
}
|
||||
|
||||
HostileReference* getReferenceByTarget(Unit* victim) const;
|
||||
HostileReference* getReferenceByTarget(ObjectGuid const& guid) const;
|
||||
|
||||
[[nodiscard]] StorageType const& getThreatList() const { return iThreatList; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user