refactor(Core/Object): adds consistency in the use of type object check (#19671)

This commit is contained in:
Grimdhex
2024-08-25 14:57:37 +02:00
committed by GitHub
parent 61f3a631c3
commit 643362d697
189 changed files with 783 additions and 775 deletions

View File

@@ -389,7 +389,7 @@ public:
void KilledUnit(Unit* pVictim) override
{
if (!urand(0, 2) && pVictim->GetTypeId() == TYPEID_PLAYER)
if (!urand(0, 2) && pVictim->IsPlayer())
{
Talk(SAY_SARTHARION_SLAY);
}

View File

@@ -308,7 +308,7 @@ public:
void KilledUnit(Unit* victim) override
{
if (victim->GetTypeId() == TYPEID_PLAYER && events.GetNextEventTime(EVENT_KILL_TALK) == 0)
if (victim->IsPlayer() && events.GetNextEventTime(EVENT_KILL_TALK) == 0)
{
Talk(SAY_KILL);
events.ScheduleEvent(EVENT_KILL_TALK, 6s);
@@ -475,7 +475,7 @@ public:
void KilledUnit(Unit* victim) override
{
if (victim->GetTypeId() == TYPEID_PLAYER && _events.GetNextEventTime(EVENT_KILL_TALK) == 0)
if (victim->IsPlayer() && _events.GetNextEventTime(EVENT_KILL_TALK) == 0)
{
Talk(SAY_KILL);
_events.ScheduleEvent(EVENT_KILL_TALK, 6s);