mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[10717] Revert "[10716][10688] New version of patch for send real diff from last update."
This reverts commit 8398a55fa274471daae115e00c627b299a3fdbbd. This reverts commit 06e2d6859ba3d7fd47be72c23a64e68ae039701f.
This commit is contained in:
parent
c1427f7d83
commit
3b0e926788
36 changed files with 145 additions and 180 deletions
|
|
@ -1175,7 +1175,7 @@ void Player::SetDrunkValue(uint16 newDrunkenValue, uint32 itemId)
|
|||
SendMessageToSet(&data, true);
|
||||
}
|
||||
|
||||
void Player::Update(uint32 update_diff, uint32 tick_diff)
|
||||
void Player::Update( uint32 p_time )
|
||||
{
|
||||
if(!IsInWorld())
|
||||
return;
|
||||
|
|
@ -1195,21 +1195,25 @@ void Player::Update(uint32 update_diff, uint32 tick_diff)
|
|||
|
||||
//used to implement delayed far teleports
|
||||
SetCanDelayTeleport(true);
|
||||
Unit::Update(update_diff, tick_diff);
|
||||
Unit::Update( p_time );
|
||||
SetCanDelayTeleport(false);
|
||||
|
||||
// update player only attacks
|
||||
if (uint32 ranged_att = getAttackTimer(RANGED_ATTACK))
|
||||
setAttackTimer(RANGED_ATTACK, (update_diff >= ranged_att ? 0 : ranged_att - update_diff) );
|
||||
if(uint32 ranged_att = getAttackTimer(RANGED_ATTACK))
|
||||
{
|
||||
setAttackTimer(RANGED_ATTACK, (p_time >= ranged_att ? 0 : ranged_att - p_time) );
|
||||
}
|
||||
|
||||
if (uint32 off_att = getAttackTimer(OFF_ATTACK))
|
||||
setAttackTimer(OFF_ATTACK, (update_diff >= off_att ? 0 : off_att - update_diff) );
|
||||
if(uint32 off_att = getAttackTimer(OFF_ATTACK))
|
||||
{
|
||||
setAttackTimer(OFF_ATTACK, (p_time >= off_att ? 0 : off_att - p_time) );
|
||||
}
|
||||
|
||||
time_t now = time (NULL);
|
||||
|
||||
UpdatePvPFlag(now);
|
||||
|
||||
UpdateContestedPvP(update_diff);
|
||||
UpdateContestedPvP(p_time);
|
||||
|
||||
UpdateDuelFlag(now);
|
||||
|
||||
|
|
@ -1227,7 +1231,7 @@ void Player::Update(uint32 update_diff, uint32 tick_diff)
|
|||
while (iter != m_timedquests.end())
|
||||
{
|
||||
QuestStatusData& q_status = mQuestStatus[*iter];
|
||||
if (q_status.m_timer <= update_diff)
|
||||
if( q_status.m_timer <= p_time )
|
||||
{
|
||||
uint32 quest_id = *iter;
|
||||
++iter; // current iter will be removed in FailQuest
|
||||
|
|
@ -1235,7 +1239,7 @@ void Player::Update(uint32 update_diff, uint32 tick_diff)
|
|||
}
|
||||
else
|
||||
{
|
||||
q_status.m_timer -= update_diff;
|
||||
q_status.m_timer -= p_time;
|
||||
if (q_status.uState != QUEST_NEW) q_status.uState = QUEST_CHANGED;
|
||||
++iter;
|
||||
}
|
||||
|
|
@ -1338,49 +1342,49 @@ void Player::Update(uint32 update_diff, uint32 tick_diff)
|
|||
|
||||
if (m_regenTimer)
|
||||
{
|
||||
if (update_diff >= m_regenTimer)
|
||||
if(p_time >= m_regenTimer)
|
||||
m_regenTimer = 0;
|
||||
else
|
||||
m_regenTimer -= update_diff;
|
||||
m_regenTimer -= p_time;
|
||||
}
|
||||
|
||||
if (m_weaponChangeTimer > 0)
|
||||
{
|
||||
if (update_diff >= m_weaponChangeTimer)
|
||||
if(p_time >= m_weaponChangeTimer)
|
||||
m_weaponChangeTimer = 0;
|
||||
else
|
||||
m_weaponChangeTimer -= update_diff;
|
||||
m_weaponChangeTimer -= p_time;
|
||||
}
|
||||
|
||||
if (m_zoneUpdateTimer > 0)
|
||||
{
|
||||
if (update_diff >= m_zoneUpdateTimer)
|
||||
if(p_time >= m_zoneUpdateTimer)
|
||||
{
|
||||
uint32 newzone, newarea;
|
||||
GetZoneAndAreaId(newzone,newarea);
|
||||
|
||||
if (m_zoneUpdateId != newzone)
|
||||
if( m_zoneUpdateId != newzone )
|
||||
UpdateZone(newzone,newarea); // also update area
|
||||
else
|
||||
{
|
||||
// use area updates as well
|
||||
// needed for free far all arenas for example
|
||||
if (m_areaUpdateId != newarea)
|
||||
if( m_areaUpdateId != newarea )
|
||||
UpdateArea(newarea);
|
||||
|
||||
m_zoneUpdateTimer = ZONE_UPDATE_INTERVAL;
|
||||
}
|
||||
}
|
||||
else
|
||||
m_zoneUpdateTimer -= update_diff;
|
||||
m_zoneUpdateTimer -= p_time;
|
||||
}
|
||||
|
||||
if (m_timeSyncTimer > 0)
|
||||
{
|
||||
if (update_diff >= m_timeSyncTimer)
|
||||
if(p_time >= m_timeSyncTimer)
|
||||
SendTimeSync();
|
||||
else
|
||||
m_timeSyncTimer -= update_diff;
|
||||
m_timeSyncTimer -= p_time;
|
||||
}
|
||||
|
||||
if (isAlive())
|
||||
|
|
@ -1396,31 +1400,31 @@ void Player::Update(uint32 update_diff, uint32 tick_diff)
|
|||
if (m_deathState == JUST_DIED)
|
||||
KillPlayer();
|
||||
|
||||
if (m_nextSave > 0)
|
||||
if(m_nextSave > 0)
|
||||
{
|
||||
if (update_diff >= m_nextSave)
|
||||
if(p_time >= m_nextSave)
|
||||
{
|
||||
// m_nextSave reseted in SaveToDB call
|
||||
SaveToDB();
|
||||
DETAIL_LOG("Player '%s' (GUID: %u) saved", GetName(), GetGUIDLow());
|
||||
}
|
||||
else
|
||||
m_nextSave -= update_diff;
|
||||
m_nextSave -= p_time;
|
||||
}
|
||||
|
||||
//Handle Water/drowning
|
||||
HandleDrowning(update_diff);
|
||||
HandleDrowning(p_time);
|
||||
|
||||
//Handle detect stealth players
|
||||
if (m_DetectInvTimer > 0)
|
||||
{
|
||||
if (update_diff >= m_DetectInvTimer)
|
||||
if (p_time >= m_DetectInvTimer)
|
||||
{
|
||||
HandleStealthedUnitsDetection();
|
||||
m_DetectInvTimer = 3000;
|
||||
}
|
||||
else
|
||||
m_DetectInvTimer -= update_diff;
|
||||
m_DetectInvTimer -= p_time;
|
||||
}
|
||||
|
||||
// Played time
|
||||
|
|
@ -1434,27 +1438,27 @@ void Player::Update(uint32 update_diff, uint32 tick_diff)
|
|||
|
||||
if (m_drunk)
|
||||
{
|
||||
m_drunkTimer += update_diff;
|
||||
m_drunkTimer += p_time;
|
||||
|
||||
if (m_drunkTimer > 10*IN_MILLISECONDS)
|
||||
HandleSobering();
|
||||
}
|
||||
|
||||
// not auto-free ghost from body in instances
|
||||
if (m_deathTimer > 0 && !GetBaseMap()->Instanceable())
|
||||
if(m_deathTimer > 0 && !GetBaseMap()->Instanceable())
|
||||
{
|
||||
if(update_diff >= m_deathTimer)
|
||||
if(p_time >= m_deathTimer)
|
||||
{
|
||||
m_deathTimer = 0;
|
||||
BuildPlayerRepop();
|
||||
RepopAtGraveyard();
|
||||
}
|
||||
else
|
||||
m_deathTimer -= update_diff;
|
||||
m_deathTimer -= p_time;
|
||||
}
|
||||
|
||||
UpdateEnchantTime(update_diff);
|
||||
UpdateHomebindTime(update_diff);
|
||||
UpdateEnchantTime(p_time);
|
||||
UpdateHomebindTime(p_time);
|
||||
|
||||
// group update
|
||||
SendUpdateToOutOfRangeGroupMembers();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue