Small fix

This commit is contained in:
tomrus88 2008-11-05 22:02:16 +03:00
parent d48844a699
commit 3f1da2602e

View file

@ -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
} }