aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-06-18 17:06:59 -0500
committermegamage <none@none>2009-06-18 17:06:59 -0500
commit4f0ae7903630fb40d4cfb5a3b08cfd43a2b54f74 (patch)
tree11a6c69fadfe18ca77461d0548210a2a0738986c /src/game/Player.cpp
parentc4a8da0e32d43099c3bc3797aecc94070ab6a0d3 (diff)
[8041] Avoid send talent info many times at loading. Small cleanups. Author: VladimirMangos
--HG-- branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index e6772a5fa8f..09468436aa9 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -426,7 +426,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
m_lastPotionId = 0;
m_activeSpec = 0;
- m_specsCount = 0;
+ m_specsCount = 1;
for (uint8 i = 0; i < BASEMOD_END; ++i)
{
@@ -2438,7 +2438,8 @@ void Player::InitTalentForLevel()
SetFreeTalentPoints(talentPointsForLevel-m_usedTalentCount);
}
- SendTalentsInfoData(false); // update at client
+ if(!GetSession()->PlayerLoading())
+ SendTalentsInfoData(false); // update at client
}
void Player::InitStatsForLevel(bool reapplyMods)
@@ -3367,7 +3368,6 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool update_action_bar_
}
}
-
void Player::RemoveSpellCooldown( uint32 spell_id, bool update /* = false */ )
{
m_spellCooldowns.erase(spell_id);
@@ -20813,14 +20813,13 @@ bool Player::canSeeSpellClickOn(Creature const *c) const
void Player::BuildPlayerTalentsInfoData(WorldPacket *data)
{
*data << uint32(GetFreeTalentPoints()); // unspentTalentPoints
- uint8 talentGroupCount = 1;
- *data << uint8(talentGroupCount); // talent group count (0, 1 or 2)
- *data << uint8(0); // talent group index (0 or 1)
+ *data << uint8(m_specsCount); // talent group count (0, 1 or 2)
+ *data << uint8(m_activeSpec); // talent group index (0 or 1)
- if(talentGroupCount)
+ if(m_specsCount)
{
// loop through all specs (only 1 for now)
- for(uint8 groups = 0; groups < talentGroupCount; ++groups)
+ for(uint32 specIdx = 0; specIdx < m_specsCount; ++specIdx)
{
uint8 talentIdCount = 0;
size_t pos = data->wpos();
@@ -20845,7 +20844,7 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket *data)
// find max talent rank
int32 curtalent_maxrank = -1;
- for(int32 k = 4; k > -1; --k)
+ for(int32 k = MAX_TALENT_RANK-1; k > -1; --k)
{
if(talentInfo->RankID[k] && HasSpell(talentInfo->RankID[k]))
{
@@ -21119,4 +21118,4 @@ void Player::ActivateSpec(uint32 specNum)
return;
resetTalents(true);
-} \ No newline at end of file
+}