diff options
-rw-r--r-- | src/game/Player.cpp | 14 |
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(); |