diff options
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r-- | src/game/Player.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 17203faadde..160737ecfd8 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -3528,10 +3528,7 @@ bool Player::resetTalents(bool no_cost) { // not need after this call if(HasAtLoginFlag(AT_LOGIN_RESET_TALENTS)) - { - m_atLoginFlags = m_atLoginFlags & ~AT_LOGIN_RESET_TALENTS; - CharacterDatabase.PExecute("UPDATE characters set at_login = at_login & ~ %u WHERE guid ='%u'", uint32(AT_LOGIN_RESET_TALENTS), GetGUIDLow()); - } + RemoveAtLoginFlag(AT_LOGIN_RESET_TALENTS,true); uint32 talentPointsForLevel = CalculateTalentsPoints(); @@ -16000,7 +15997,7 @@ void Player::SaveToDB() ss << uint32(m_stableSlots); // to prevent save uint8 as char ss << ", "; - ss << uint32(m_atLoginFlags & ((1<<AT_LOAD_PET_FLAGS) -1)); + ss << uint32(m_atLoginFlags); ss << ", "; ss << GetZoneId(); @@ -18883,10 +18880,7 @@ void Player::resetSpells() { // not need after this call if(HasAtLoginFlag(AT_LOGIN_RESET_SPELLS)) - { - m_atLoginFlags = m_atLoginFlags & ~AT_LOGIN_RESET_SPELLS; - CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login & ~ %u WHERE guid ='%u'", uint32(AT_LOGIN_RESET_SPELLS), GetGUIDLow()); - } + RemoveAtLoginFlag(AT_LOGIN_RESET_SPELLS,true); // make full copy of map (spells removed and marked as deleted at another spell remove // and we can't use original map for safe iterative with visit each spell at loop end @@ -21130,3 +21124,11 @@ void Player::ActivateSpec(uint32 specNum) resetTalents(true); } + +void Player::RemoveAtLoginFlag( AtLoginFlags f, bool in_db_also /*= false*/ ) +{ + m_atLoginFlags &= ~f; + + if(in_db_also) + CharacterDatabase.PExecute("UPDATE characters set at_login = at_login & ~ %u WHERE guid ='%u'", uint32(f), GetGUIDLow()); +} |