[10924] Send time diff between Update() calls for object - should help with mob respawn on inactive grids etc. Based on patches by VladimirMangos and cipherCOM. All issues from previous patches should be finally fixed now.

Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
Ambal 2010-12-27 22:16:19 +02:00
parent 72b1d30a1c
commit b11820593c
39 changed files with 284 additions and 149 deletions

View file

@ -31,7 +31,7 @@ Totem::Totem() : Creature(CREATURE_SUBTYPE_TOTEM)
m_type = TOTEM_PASSIVE;
}
void Totem::Update( uint32 time )
void Totem::Update(uint32 update_diff, uint32 time )
{
Unit *owner = GetOwner();
if (!owner || !owner->isAlive() || !isAlive())
@ -40,15 +40,15 @@ void Totem::Update( uint32 time )
return;
}
if (m_duration <= time)
if (m_duration <= update_diff)
{
UnSummon(); // remove self
return;
}
else
m_duration -= time;
m_duration -= update_diff;
Creature::Update( time );
Creature::Update( update_diff, time );
}
void Totem::Summon(Unit* owner)