From 74fc50e5d457260194e7110de4b167eb5654bd06 Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 15 Apr 2009 17:30:11 -0500 Subject: [7673] Fixed pet spell cooldown values send in Player::PetSpellInitialize to client. Author: VladimirMangos --HG-- branch : trunk --- src/game/Player.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src') 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(); -- cgit v1.2.3