mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
Fix the incorrect logic of threat online status check. Also add targets in other map or phase to offline container.
This commit is contained in:
@@ -178,11 +178,13 @@ void HostileReference::updateOnlineStatus()
|
||||
// ref is valid
|
||||
// target is no player or not gamemaster
|
||||
// target is not in flight
|
||||
if (isValid() &&
|
||||
((getTarget()->GetTypeId() != TYPEID_PLAYER || !getTarget()->ToPlayer()->isGameMaster()) ||
|
||||
!getTarget()->HasUnitState(UNIT_STAT_IN_FLIGHT)))
|
||||
if (isValid()
|
||||
&& (getTarget()->GetTypeId() != TYPEID_PLAYER || !getTarget()->ToPlayer()->isGameMaster())
|
||||
&& !getTarget()->HasUnitState(UNIT_STAT_IN_FLIGHT)
|
||||
&& getTarget()->IsInMap(getSourceUnit())
|
||||
)
|
||||
{
|
||||
Creature* creature = getSourceUnit()->ToCreature();
|
||||
Creature* creature = getSourceUnit()->ToCreature();
|
||||
online = getTarget()->isInAccessiblePlaceFor(creature);
|
||||
if (!online)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user