[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

@ -26,7 +26,7 @@ Creature(CREATURE_SUBTYPE_TEMPORARY_SUMMON), m_type(TEMPSUMMON_TIMED_OR_CORPSE_D
{
}
void TemporarySummon::Update( uint32 diff )
void TemporarySummon::Update( uint32 update_diff, uint32 diff )
{
switch(m_type)
{
@ -34,26 +34,26 @@ void TemporarySummon::Update( uint32 diff )
break;
case TEMPSUMMON_TIMED_DESPAWN:
{
if (m_timer <= diff)
if (m_timer <= update_diff)
{
UnSummon();
return;
}
m_timer -= diff;
m_timer -= update_diff;
break;
}
case TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT:
{
if (!isInCombat())
{
if (m_timer <= diff)
if (m_timer <= update_diff)
{
UnSummon();
return;
}
m_timer -= diff;
m_timer -= update_diff;
}
else if (m_timer != m_lifetime)
m_timer = m_lifetime;
@ -65,13 +65,13 @@ void TemporarySummon::Update( uint32 diff )
{
if (IsCorpse())
{
if (m_timer <= diff)
if (m_timer <= update_diff)
{
UnSummon();
return;
}
m_timer -= diff;
m_timer -= update_diff;
}
break;
}
@ -106,13 +106,13 @@ void TemporarySummon::Update( uint32 diff )
if (!isInCombat())
{
if (m_timer <= diff)
if (m_timer <= update_diff)
{
UnSummon();
return;
}
else
m_timer -= diff;
m_timer -= update_diff;
}
else if (m_timer != m_lifetime)
m_timer = m_lifetime;
@ -129,13 +129,13 @@ void TemporarySummon::Update( uint32 diff )
if (!isInCombat() && isAlive() )
{
if (m_timer <= diff)
if (m_timer <= update_diff)
{
UnSummon();
return;
}
else
m_timer -= diff;
m_timer -= update_diff;
}
else if (m_timer != m_lifetime)
m_timer = m_lifetime;
@ -147,7 +147,7 @@ void TemporarySummon::Update( uint32 diff )
break;
}
Creature::Update( diff );
Creature::Update( update_diff, diff );
}
void TemporarySummon::Summon(TempSummonType type, uint32 lifetime)