chore(Cleanup): Merge redundant if in Totem::Update() (#12423)

TotemUpdate-too-long
This commit is contained in:
Synful-Syn
2022-07-24 13:29:13 -04:00
committed by GitHub
parent 6b5370a75f
commit d2f126710f

View File

@@ -34,20 +34,13 @@ Totem::Totem(SummonPropertiesEntry const* properties, ObjectGuid owner) : Minion
void Totem::Update(uint32 time)
{
Unit* owner = GetOwner();
if (!owner || !owner->IsAlive() || !IsAlive())
if (!owner || !owner->IsAlive() || !IsAlive() || m_duration <= time)
{
UnSummon(); // remove self
return;
}
if (m_duration <= time)
{
UnSummon(); // remove self
return;
}
else
m_duration -= time;
m_duration -= time;
Creature::Update(time);
}