diff options
author | Machiavelli <none@none> | 2009-08-15 17:05:34 +0200 |
---|---|---|
committer | Machiavelli <none@none> | 2009-08-15 17:05:34 +0200 |
commit | 2057f7d01d91ce65195d9196e0f23ef46b666059 (patch) | |
tree | 46cb8b5b79f62a37d465141c065d73a7197e2bae /src | |
parent | 230d112282953a8da9c10c18d19c8e498ac89407 (diff) |
*Fix logical error in Player::LoadFromDB regarding dual speccing, and relocate code for consistency
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Player.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 24b7d336d62..463398eeab2 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -14644,13 +14644,6 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) return false; } - m_specsCount = fields[42].GetUInt32(); - m_activeSpec = fields[43].GetUInt32(); - - // sanity check - if (m_specsCount < 2) // Maybe better to check MAX_TALENT_SPECS? - m_activeSpec = 0; - Object::_Create( guid, 0, HIGHGUID_PLAYER ); m_name = fields[3].GetCppString(); @@ -15070,7 +15063,17 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) //mails are loaded only when needed ;-) - when player in game click on mailbox. //_LoadMail(); + + m_specsCount = fields[42].GetUInt32(); + m_activeSpec = fields[43].GetUInt32(); + // sanity check + if (m_specsCount > MAX_TALENT_SPECS || m_activeSpec > MAX_TALENT_SPECS) // if (m_specsCount < 2) is not logical + { + m_activeSpec = 0; + sLog.outError("Player %s(GUID: %u) has SpecCount = %u and ActiveSpec = %u.", GetName(), GetGUIDLow(), m_specsCount, m_activeSpec); + } + _LoadTalents(holder->GetResult(PLAYER_LOGIN_QUERY_LOADTALENTS)); _LoadSpells(holder->GetResult(PLAYER_LOGIN_QUERY_LOADSPELLS)); |