chore(Cleanup): Merge redundant if in Totem::Update() (#12423)
TotemUpdate-too-long
This commit is contained in:
@@ -34,20 +34,13 @@ Totem::Totem(SummonPropertiesEntry const* properties, ObjectGuid owner) : Minion
|
|||||||
void Totem::Update(uint32 time)
|
void Totem::Update(uint32 time)
|
||||||
{
|
{
|
||||||
Unit* owner = GetOwner();
|
Unit* owner = GetOwner();
|
||||||
if (!owner || !owner->IsAlive() || !IsAlive())
|
if (!owner || !owner->IsAlive() || !IsAlive() || m_duration <= time)
|
||||||
{
|
{
|
||||||
UnSummon(); // remove self
|
UnSummon(); // remove self
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_duration <= time)
|
m_duration -= time;
|
||||||
{
|
|
||||||
UnSummon(); // remove self
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
m_duration -= time;
|
|
||||||
|
|
||||||
Creature::Update(time);
|
Creature::Update(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user