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

Now in case when creature/etc some tices not updates in result stay
in not active (no near players or active objects) cell some important
timers (corpse decay, summon timers, group loot expire, aura durations, etc) will
updates at real diff time from last prev. update call.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>

For some systems added exclude use real diff time because current limitations
like move generators. So its stay use last tick diff and considered freeze and
skip all time while creature in not active map part.
This commit is contained in:
cipherCOM 2010-11-03 06:49:18 +03:00 committed by VladimirMangos
parent 62c0963f37
commit 555c1a9094
35 changed files with 162 additions and 149 deletions

View file

@ -103,6 +103,16 @@ void Object::_Create(uint32 guidlow, uint32 entry, HighGuid guidhigh)
m_PackGUID.Set(guid);
}
void WorldObject::UpdateCall(uint32 newtime, uint32 diff)
{
// use real time diff from last object update call
// this can have big diff from tick diff time for object returning to active zone)
uint32 realDiff = getMSTimeDiff(m_lastUpdateTime, newtime);
m_lastUpdateTime = newtime;
Update(realDiff, diff);
}
void Object::SetObjectScale(float newScale)
{
SetFloatValue(OBJECT_FIELD_SCALE_X, newScale);
@ -1121,7 +1131,7 @@ void Object::BuildUpdateData( UpdateDataMapType& /*update_players */)
WorldObject::WorldObject()
: m_isActiveObject(false), m_currMap(NULL), m_mapId(0), m_InstanceId(0), m_phaseMask(PHASEMASK_NORMAL),
m_positionX(0.0f), m_positionY(0.0f), m_positionZ(0.0f), m_orientation(0.0f)
m_positionX(0.0f), m_positionY(0.0f), m_positionZ(0.0f), m_orientation(0.0f), m_lastUpdateTime(getMSTime())
{
}
@ -2084,4 +2094,4 @@ bool WorldObject::IsControlledByPlayer() const
default:
return false;
}
}
}