aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-15 17:30:11 -0500
committermegamage <none@none>2009-04-15 17:30:11 -0500
commit74fc50e5d457260194e7110de4b167eb5654bd06 (patch)
treee04b470c726677133c2d5db40573b9bc13411a3f /src
parentc5310844db5de639f4316d4d9eed9254d24009cb (diff)
[7673] Fixed pet spell cooldown values send in Player::PetSpellInitialize to client. Author: VladimirMangos
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Player.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 803f2b5ecef..96548d84893 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -16647,28 +16647,22 @@ void Player::PetSpellInitialize()
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) * IN_MILISECONDS;
+ time_t cooldown = (itr->second > curTime) ? (itr->second - curTime) * IN_MILISECONDS : 0;
data << uint16(itr->first); // spellid
data << uint16(0); // spell category?
- data << uint32(itr->second); // cooldown
+ data << uint32(cooldown); // cooldown
data << uint32(0); // category cooldown
}
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) * IN_MILISECONDS;
+ time_t cooldown = (itr->second > curTime) ? (itr->second - curTime) * IN_MILISECONDS : 0;
data << uint16(itr->first); // spellid
data << uint16(0); // spell category?
data << uint32(0); // cooldown
- data << uint32(itr->second); // category cooldown
+ data << uint32(cooldown); // category cooldown
}
data.hexlike();