refactor(Core): DespawnOrUnsummon (#23141)

This commit is contained in:
天鹭
2025-10-13 14:36:23 +08:00
committed by GitHub
parent 8e2e30328f
commit 53238a68d3
148 changed files with 363 additions and 366 deletions

View File

@@ -692,7 +692,7 @@ void Pet::Update(uint32 diff)
}
}
if (m_duration > 0s)
if (m_duration > 0ms)
{
if (m_duration > _diff)
m_duration -= _diff;
@@ -708,7 +708,7 @@ void Pet::Update(uint32 diff)
if (getPowerType() == POWER_FOCUS)
{
m_petRegenTimer -= _diff;
if (m_petRegenTimer <= 0s)
if (m_petRegenTimer <= 0ms)
{
m_petRegenTimer += PET_FOCUS_REGEN_INTERVAL;
Regenerate(POWER_FOCUS);
@@ -1026,7 +1026,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
Unit* owner = GetOwner();
if (!owner) // just to be sure, asynchronous now
{
DespawnOrUnsummon(1000);
DespawnOrUnsummon(1s);
return false;
}

View File

@@ -52,7 +52,7 @@ public:
PetType getPetType() const { return m_petType; }
void setPetType(PetType type) { m_petType = type; }
bool isControlled() const { return getPetType() == SUMMON_PET || getPetType() == HUNTER_PET; }
bool isTemporarySummoned() const { return m_duration > 0s; }
bool isTemporarySummoned() const { return m_duration > 0ms; }
bool IsPermanentPetFor(Player* owner) const; // pet have tab in character windows and set UNIT_FIELD_PETNUMBER