mirror of
https://github.com/mangosfour/server.git
synced 2025-12-24 19:37:07 +00:00
[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:
parent
2f144d9d29
commit
0847d4c8cd
35 changed files with 149 additions and 162 deletions
|
|
@ -482,7 +482,7 @@ void Pet::SetDeathState(DeathState s) // overwrite virtual
|
|||
}
|
||||
}
|
||||
|
||||
void Pet::Update(uint32 update_diff, uint32 tick_diff)
|
||||
void Pet::Update(uint32 diff)
|
||||
{
|
||||
if(m_removed) // pet already removed, just wait in remove queue, no updates
|
||||
return;
|
||||
|
|
@ -491,7 +491,7 @@ void Pet::Update(uint32 update_diff, uint32 tick_diff)
|
|||
{
|
||||
case CORPSE:
|
||||
{
|
||||
if (m_corpseDecayTimer <= update_diff)
|
||||
if (m_corpseDecayTimer <= diff)
|
||||
{
|
||||
MANGOS_ASSERT(getPetType()!=SUMMON_PET && "Must be already removed.");
|
||||
Remove(PET_SAVE_NOT_IN_SLOT); //hunters' pets never get removed because of death, NEVER!
|
||||
|
|
@ -520,8 +520,8 @@ void Pet::Update(uint32 update_diff, uint32 tick_diff)
|
|||
|
||||
if (m_duration > 0)
|
||||
{
|
||||
if (m_duration > (int32)update_diff)
|
||||
m_duration -= (int32)update_diff;
|
||||
if(m_duration > (int32)diff)
|
||||
m_duration -= (int32)diff;
|
||||
else
|
||||
{
|
||||
Remove(getPetType() != SUMMON_PET ? PET_SAVE_AS_DELETED:PET_SAVE_NOT_IN_SLOT);
|
||||
|
|
@ -530,7 +530,7 @@ void Pet::Update(uint32 update_diff, uint32 tick_diff)
|
|||
}
|
||||
|
||||
//regenerate focus for hunter pets or energy for deathknight's ghoul
|
||||
if (m_regenTimer <= update_diff)
|
||||
if(m_regenTimer <= diff)
|
||||
{
|
||||
switch (getPowerType())
|
||||
{
|
||||
|
|
@ -544,25 +544,25 @@ void Pet::Update(uint32 update_diff, uint32 tick_diff)
|
|||
m_regenTimer = 4000;
|
||||
}
|
||||
else
|
||||
m_regenTimer -= update_diff;
|
||||
m_regenTimer -= diff;
|
||||
|
||||
if (getPetType() != HUNTER_PET)
|
||||
if(getPetType() != HUNTER_PET)
|
||||
break;
|
||||
|
||||
if (m_happinessTimer <= update_diff)
|
||||
if(m_happinessTimer <= diff)
|
||||
{
|
||||
LooseHappiness();
|
||||
m_happinessTimer = 7500;
|
||||
}
|
||||
else
|
||||
m_happinessTimer -= update_diff;
|
||||
m_happinessTimer -= diff;
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
Creature::Update(update_diff, tick_diff);
|
||||
Creature::Update(diff);
|
||||
}
|
||||
|
||||
void Pet::Regenerate(Powers power)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue