diff options
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r-- | src/game/Player.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index c1271395838..40dc8b21c62 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -5849,6 +5849,11 @@ void Player::removeActionButton(uint8 button) if (buttonItr==m_actionButtons.end()) return; + if (!buttonItr->second.canRemoveByClient) + { + buttonItr->second.canRemoveByClient = true; + return; + } if(buttonItr->second.uState==ACTIONBUTTON_NEW) m_actionButtons.erase(buttonItr); // new and not saved else @@ -15126,7 +15131,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) // update items with duration and realtime UpdateItemDuration(time_diff, true); - _LoadActions(holder->GetResult(PLAYER_LOGIN_QUERY_LOADACTIONS)); + _LoadActions(holder->GetResult(PLAYER_LOGIN_QUERY_LOADACTIONS), true); // unread mails and next delivery time, actual mails not loaded _LoadMailInit(holder->GetResult(PLAYER_LOGIN_QUERY_LOADMAILCOUNT), holder->GetResult(PLAYER_LOGIN_QUERY_LOADMAILDATE)); @@ -15255,7 +15260,7 @@ bool Player::isAllowedToLoot(Creature* creature) return !creature->hasLootRecipient(); } -void Player::_LoadActions(QueryResult *result) +void Player::_LoadActions(QueryResult *result, bool startup) { if(result) { @@ -15268,7 +15273,11 @@ void Player::_LoadActions(QueryResult *result) uint8 type = fields[2].GetUInt8(); if(ActionButton* ab = addActionButton(button, action, type)) + { ab->uState = ACTIONBUTTON_UNCHANGED; + if(!startup) // Switching specs + ab->canRemoveByClient = false; + } else { sLog.outError( " ...at loading, and will deleted in DB also"); @@ -21856,7 +21865,7 @@ void Player::ActivateSpec(uint8 spec) QueryResult *result = CharacterDatabase.PQuery("SELECT button,action,type FROM character_action WHERE guid = '%u' AND spec = '%u' ORDER BY button", GetGUIDLow(), m_activeSpec); if (result) { - _LoadActions(result); + _LoadActions(result, false); } UnsummonPetTemporaryIfAny(); AutoUnequipOffhandIfNeed(); |