mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
Small fix
This commit is contained in:
parent
d48844a699
commit
3f1da2602e
1 changed files with 14 additions and 2 deletions
|
|
@ -16045,18 +16045,30 @@ void Player::PetSpellInitialize()
|
||||||
uint8 cooldownsCount = pet->m_CreatureSpellCooldowns.size() + pet->m_CreatureCategoryCooldowns.size();
|
uint8 cooldownsCount = pet->m_CreatureSpellCooldowns.size() + pet->m_CreatureCategoryCooldowns.size();
|
||||||
data << uint8(cooldownsCount);
|
data << uint8(cooldownsCount);
|
||||||
|
|
||||||
|
time_t curTime = time(NULL);
|
||||||
|
|
||||||
for(CreatureSpellCooldowns::const_iterator itr = pet->m_CreatureSpellCooldowns.begin(); itr != pet->m_CreatureSpellCooldowns.end(); ++itr)
|
for(CreatureSpellCooldowns::const_iterator itr = pet->m_CreatureSpellCooldowns.begin(); itr != pet->m_CreatureSpellCooldowns.end(); ++itr)
|
||||||
{
|
{
|
||||||
|
time_t cooldown = 0;
|
||||||
|
|
||||||
|
if(itr->second > curTime)
|
||||||
|
cooldown = (itr->second - curTime) * 1000;
|
||||||
|
|
||||||
data << uint16(itr->first); // spellid
|
data << uint16(itr->first); // spellid
|
||||||
data << uint16(0); // unk
|
data << uint16(0); // spell category?
|
||||||
data << uint32(itr->second); // cooldown
|
data << uint32(itr->second); // cooldown
|
||||||
data << uint32(0); // category cooldown
|
data << uint32(0); // category cooldown
|
||||||
}
|
}
|
||||||
|
|
||||||
for(CreatureSpellCooldowns::const_iterator itr = pet->m_CreatureCategoryCooldowns.begin(); itr != pet->m_CreatureCategoryCooldowns.end(); ++itr)
|
for(CreatureSpellCooldowns::const_iterator itr = pet->m_CreatureCategoryCooldowns.begin(); itr != pet->m_CreatureCategoryCooldowns.end(); ++itr)
|
||||||
{
|
{
|
||||||
|
time_t cooldown = 0;
|
||||||
|
|
||||||
|
if(itr->second > curTime)
|
||||||
|
cooldown = (itr->second - curTime) * 1000;
|
||||||
|
|
||||||
data << uint16(itr->first); // spellid
|
data << uint16(itr->first); // spellid
|
||||||
data << uint16(0); // unk
|
data << uint16(0); // spell category?
|
||||||
data << uint32(0); // cooldown
|
data << uint32(0); // cooldown
|
||||||
data << uint32(itr->second); // category cooldown
|
data << uint32(itr->second); // category cooldown
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue