mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[10688] New version of patch for send real diff from last update.
In new version last update time stopred for specific Cell that store all world objects placed in it. All objects of Cell updated (or not updated) in same time. Original version provided by ciphercom.
This commit is contained in:
parent
464908f453
commit
e219ee99bb
36 changed files with 183 additions and 151 deletions
|
|
@ -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 tick_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;
|
||||
|
|
@ -63,22 +63,22 @@ void TemporarySummon::Update( uint32 diff )
|
|||
|
||||
case TEMPSUMMON_CORPSE_TIMED_DESPAWN:
|
||||
{
|
||||
if ( m_deathState == CORPSE)
|
||||
if (m_deathState == CORPSE)
|
||||
{
|
||||
if (m_timer <= diff)
|
||||
if (m_timer <= update_diff)
|
||||
{
|
||||
UnSummon();
|
||||
return;
|
||||
}
|
||||
|
||||
m_timer -= diff;
|
||||
m_timer -= update_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 diff )
|
|||
}
|
||||
case TEMPSUMMON_DEAD_DESPAWN:
|
||||
{
|
||||
if ( m_deathState == DEAD )
|
||||
if (m_deathState == DEAD)
|
||||
{
|
||||
UnSummon();
|
||||
return;
|
||||
|
|
@ -98,7 +98,7 @@ void TemporarySummon::Update( uint32 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 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, tick_diff);
|
||||
}
|
||||
|
||||
void TemporarySummon::Summon(TempSummonType type, uint32 lifetime)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue