[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

@ -406,7 +406,7 @@ uint32 Creature::ChooseDisplayId(const CreatureInfo *cinfo, const CreatureData *
return display_id;
}
void Creature::Update(uint32 update_diff, uint32 tick_diff)
void Creature::Update(uint32 diff)
{
if (m_needNotify)
{
@ -467,7 +467,7 @@ void Creature::Update(uint32 update_diff, uint32 tick_diff)
if (m_isDeadByDefault)
break;
if (m_corpseDecayTimer <= update_diff)
if (m_corpseDecayTimer <= diff)
{
// since pool system can fail to roll unspawned object, this one can remain spawned, so must set respawn nevertheless
uint16 poolid = GetDBTableGUIDLow() ? sPoolMgr.IsPartOfAPool<Creature>(GetDBTableGUIDLow()) : 0;
@ -482,11 +482,11 @@ void Creature::Update(uint32 update_diff, uint32 tick_diff)
}
else
{
m_corpseDecayTimer -= update_diff;
m_corpseDecayTimer -= diff;
if (m_groupLootId)
{
if(update_diff < m_groupLootTimer)
m_groupLootTimer -= update_diff;
if(diff < m_groupLootTimer)
m_groupLootTimer -= diff;
else
StopGroupLoot();
}
@ -498,7 +498,7 @@ void Creature::Update(uint32 update_diff, uint32 tick_diff)
{
if (m_isDeadByDefault)
{
if (m_corpseDecayTimer <= update_diff)
if (m_corpseDecayTimer <= diff)
{
// since pool system can fail to roll unspawned object, this one can remain spawned, so must set respawn nevertheless
uint16 poolid = GetDBTableGUIDLow() ? sPoolMgr.IsPartOfAPool<Creature>(GetDBTableGUIDLow()) : 0;
@ -516,11 +516,11 @@ void Creature::Update(uint32 update_diff, uint32 tick_diff)
}
else
{
m_corpseDecayTimer -= update_diff;
m_corpseDecayTimer -= diff;
}
}
Unit::Update(update_diff, tick_diff);
Unit::Update( diff );
// creature can be dead after Unit::Update call
// CORPSE/DEAD state will processed at next tick (in other case death timer will be updated unexpectedly)
@ -531,7 +531,7 @@ void Creature::Update(uint32 update_diff, uint32 tick_diff)
{
// do not allow the AI to be changed during update
m_AI_locked = true;
i_AI->UpdateAI(tick_diff); // AI not react good at real update delays (while freeze in non-active part of map)
i_AI->UpdateAI(diff);
m_AI_locked = false;
}
@ -541,10 +541,10 @@ void Creature::Update(uint32 update_diff, uint32 tick_diff)
break;
if(m_regenTimer > 0)
{
if(update_diff >= m_regenTimer)
if(diff >= m_regenTimer)
m_regenTimer = 0;
else
m_regenTimer -= update_diff;
m_regenTimer -= diff;
}
if (m_regenTimer != 0)
break;