mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 14:46:24 +00:00
refactor(Core/Object): adds consistency in the use of type object check (#19671)
This commit is contained in:
@@ -66,7 +66,7 @@ bool ThreatCalcHelper::isValidProcess(Unit* hatedUnit, Unit* hatingUnit, SpellIn
|
||||
return false;
|
||||
|
||||
// not to GM
|
||||
if (hatedUnit->GetTypeId() == TYPEID_PLAYER && hatedUnit->ToPlayer()->IsGameMaster())
|
||||
if (hatedUnit->IsPlayer() && hatedUnit->ToPlayer()->IsGameMaster())
|
||||
return false;
|
||||
|
||||
// not to dead and not for dead
|
||||
@@ -498,7 +498,7 @@ void ThreatMgr::_addThreat(Unit* victim, float threat)
|
||||
HostileReference* hostileRef = new HostileReference(victim, this, 0);
|
||||
iThreatContainer.addReference(hostileRef);
|
||||
hostileRef->AddThreat(threat); // now we add the real threat
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && victim->ToPlayer()->IsGameMaster())
|
||||
if (victim->IsPlayer() && victim->ToPlayer()->IsGameMaster())
|
||||
hostileRef->setOnlineOfflineState(false); // GM is always offline
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user