[10683] Revert "[10677] Send to creature/etc Update call real diff from last update and use it."

This reverts commit 10784a8c7cc81c468b5411e973d36ecf31de9603.

Main reason: impossibility for me as commiter test problem and fix all corner cases problems.
This commit is contained in:
VladimirMangos 2010-11-05 19:51:28 +03:00
parent 2f144d9d29
commit 0847d4c8cd
35 changed files with 149 additions and 162 deletions

View file

@ -26,7 +26,7 @@ Creature(CREATURE_SUBTYPE_TEMPORARY_SUMMON), m_type(TEMPSUMMON_TIMED_OR_CORPSE_D
{
}
void TemporarySummon::Update(uint32 update_diff, uint32 tick_diff)
void TemporarySummon::Update( uint32 diff )
{
switch(m_type)
{
@ -34,26 +34,26 @@ void TemporarySummon::Update(uint32 update_diff, uint32 tick_diff)
break;
case TEMPSUMMON_TIMED_DESPAWN:
{
if (m_timer <= update_diff)
if (m_timer <= diff)
{
UnSummon();
return;
}
m_timer -= update_diff;
m_timer -= diff;
break;
}
case TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT:
{
if (!isInCombat())
{
if (m_timer <= update_diff)
if (m_timer <= diff)
{
UnSummon();
return;
}
m_timer -= update_diff;
m_timer -= diff;
}
else if (m_timer != m_lifetime)
m_timer = m_lifetime;
@ -63,22 +63,22 @@ void TemporarySummon::Update(uint32 update_diff, uint32 tick_diff)
case TEMPSUMMON_CORPSE_TIMED_DESPAWN:
{
if (m_deathState == CORPSE)
if ( m_deathState == CORPSE)
{
if (m_timer <= update_diff)
if (m_timer <= diff)
{
UnSummon();
return;
}
m_timer -= update_diff;
m_timer -= diff;
}
break;
}
case TEMPSUMMON_CORPSE_DESPAWN:
{
// if m_deathState is DEAD, CORPSE was skipped
if (m_deathState == CORPSE || m_deathState == DEAD)
if ( m_deathState == CORPSE || m_deathState == DEAD)
{
UnSummon();
return;
@ -88,7 +88,7 @@ void TemporarySummon::Update(uint32 update_diff, uint32 tick_diff)
}
case TEMPSUMMON_DEAD_DESPAWN:
{
if (m_deathState == DEAD)
if ( m_deathState == DEAD )
{
UnSummon();
return;
@ -98,7 +98,7 @@ void TemporarySummon::Update(uint32 update_diff, uint32 tick_diff)
case TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN:
{
// if m_deathState is DEAD, CORPSE was skipped
if (m_deathState == CORPSE || m_deathState == DEAD)
if ( m_deathState == CORPSE || m_deathState == DEAD)
{
UnSummon();
return;
@ -106,13 +106,13 @@ void TemporarySummon::Update(uint32 update_diff, uint32 tick_diff)
if (!isInCombat())
{
if (m_timer <= update_diff)
if (m_timer <= diff)
{
UnSummon();
return;
}
else
m_timer -= update_diff;
m_timer -= diff;
}
else if (m_timer != m_lifetime)
m_timer = m_lifetime;
@ -129,13 +129,13 @@ void TemporarySummon::Update(uint32 update_diff, uint32 tick_diff)
if (!isInCombat() && isAlive() )
{
if (m_timer <= update_diff)
if (m_timer <= diff)
{
UnSummon();
return;
}
else
m_timer -= update_diff;
m_timer -= diff;
}
else if (m_timer != m_lifetime)
m_timer = m_lifetime;
@ -147,7 +147,7 @@ void TemporarySummon::Update(uint32 update_diff, uint32 tick_diff)
break;
}
Creature::Update(update_diff, tick_diff);
Creature::Update( diff );
}
void TemporarySummon::Summon(TempSummonType type, uint32 lifetime)