Partial revert of 6ab9e720f3d2fca8bfe14b2ba857008cf018e0cd, thanks click and Liberate for talking sense into me. Only load 1 spec in memory at a time. Also fixes totem bar loading due to a typo.
--HG-- branch : trunk
This commit is contained in:
@@ -79,7 +79,7 @@ bool LoginQueryHolder::Initialize()
|
|||||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADWEKLYQUESTSTATUS,"SELECT quest FROM character_queststatus_weekly WHERE guid = '%u'", GUID_LOPART(m_guid));
|
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADWEKLYQUESTSTATUS,"SELECT quest FROM character_queststatus_weekly WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADREPUTATION, "SELECT faction,standing,flags FROM character_reputation WHERE guid = '%u'", GUID_LOPART(m_guid));
|
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADREPUTATION, "SELECT faction,standing,flags FROM character_reputation WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADINVENTORY, "SELECT data,text,bag,slot,item,item_template FROM character_inventory JOIN item_instance ON character_inventory.item = item_instance.guid WHERE character_inventory.guid = '%u' ORDER BY bag,slot", GUID_LOPART(m_guid));
|
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADINVENTORY, "SELECT data,text,bag,slot,item,item_template FROM character_inventory JOIN item_instance ON character_inventory.item = item_instance.guid WHERE character_inventory.guid = '%u' ORDER BY bag,slot", GUID_LOPART(m_guid));
|
||||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADACTIONS, "SELECT a.spec,a.button,a.action,a.type FROM character_action as a, characters as c WHERE a.guid = c.guid AND a.guid = '%u' ORDER BY spec,button", GUID_LOPART(m_guid));
|
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADACTIONS, "SELECT a.button,a.action,a.type FROM character_action as a, characters as c WHERE a.guid = c.guid AND a.spec = c.activespec AND a.guid = '%u' ORDER BY button", GUID_LOPART(m_guid));
|
||||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMAILCOUNT, "SELECT COUNT(id) FROM mail WHERE receiver = '%u' AND (checked & 1)=0 AND deliver_time <= '" UI64FMTD "'", GUID_LOPART(m_guid),(uint64)time(NULL));
|
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMAILCOUNT, "SELECT COUNT(id) FROM mail WHERE receiver = '%u' AND (checked & 1)=0 AND deliver_time <= '" UI64FMTD "'", GUID_LOPART(m_guid),(uint64)time(NULL));
|
||||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMAILDATE, "SELECT MIN(deliver_time) FROM mail WHERE receiver = '%u' AND (checked & 1)=0", GUID_LOPART(m_guid));
|
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMAILDATE, "SELECT MIN(deliver_time) FROM mail WHERE receiver = '%u' AND (checked & 1)=0", GUID_LOPART(m_guid));
|
||||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSOCIALLIST, "SELECT friend,flags,note FROM character_social WHERE guid = '%u' LIMIT 255", GUID_LOPART(m_guid));
|
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSOCIALLIST, "SELECT friend,flags,note FROM character_social WHERE guid = '%u' LIMIT 255", GUID_LOPART(m_guid));
|
||||||
|
|||||||
@@ -1020,13 +1020,12 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data)
|
|||||||
|
|
||||||
uint32 action = ACTION_BUTTON_ACTION(packetData);
|
uint32 action = ACTION_BUTTON_ACTION(packetData);
|
||||||
uint8 type = ACTION_BUTTON_TYPE(packetData);
|
uint8 type = ACTION_BUTTON_TYPE(packetData);
|
||||||
uint8 spec = GetPlayer()->GetActiveSpec();
|
|
||||||
|
|
||||||
sLog.outDetail("BUTTON: %u ACTION: %u TYPE: %u", button, action, type);
|
sLog.outDetail("BUTTON: %u ACTION: %u TYPE: %u", button, action, type);
|
||||||
if (!packetData)
|
if (!packetData)
|
||||||
{
|
{
|
||||||
sLog.outDetail("MISC: Remove action from button %u", button);
|
sLog.outDetail("MISC: Remove action from button %u", button);
|
||||||
GetPlayer()->removeActionButton(spec, button);
|
GetPlayer()->removeActionButton(button);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1049,7 +1048,7 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data)
|
|||||||
sLog.outError("MISC: Unknown action button type %u for action %u into button %u", type, action, button);
|
sLog.outError("MISC: Unknown action button type %u for action %u into button %u", type, action, button);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GetPlayer()->addActionButton(spec, button, action, type);
|
GetPlayer()->addActionButton(button, action, type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+65
-107
@@ -734,7 +734,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c
|
|||||||
|
|
||||||
// original action bar
|
// original action bar
|
||||||
for (PlayerCreateInfoActions::const_iterator action_itr = info->action.begin(); action_itr != info->action.end(); ++action_itr)
|
for (PlayerCreateInfoActions::const_iterator action_itr = info->action.begin(); action_itr != info->action.end(); ++action_itr)
|
||||||
addActionButton(0, action_itr->button,action_itr->action, action_itr->type);
|
addActionButton(action_itr->button,action_itr->action, action_itr->type);
|
||||||
|
|
||||||
// original items
|
// original items
|
||||||
CharStartOutfitEntry const* oEntry = NULL;
|
CharStartOutfitEntry const* oEntry = NULL;
|
||||||
@@ -5949,11 +5949,10 @@ void Player::SendActionButtons(uint32 state) const
|
|||||||
*/
|
*/
|
||||||
if (state != 2)
|
if (state != 2)
|
||||||
{
|
{
|
||||||
ActionButtonList const& currentActionButtons = m_actionButtons[m_activeSpec];
|
|
||||||
for (uint16 button = 0; button < MAX_ACTION_BUTTONS; ++button)
|
for (uint16 button = 0; button < MAX_ACTION_BUTTONS; ++button)
|
||||||
{
|
{
|
||||||
ActionButtonList::const_iterator itr = currentActionButtons.find(button);
|
ActionButtonList::const_iterator itr = m_actionButtons.find(button);
|
||||||
if (itr != currentActionButtons.end() && itr->second.uState != ACTIONBUTTON_DELETED)
|
if (itr != m_actionButtons.end() && itr->second.uState != ACTIONBUTTON_DELETED)
|
||||||
data << uint32(itr->second.packedData);
|
data << uint32(itr->second.packedData);
|
||||||
else
|
else
|
||||||
data << uint32(0);
|
data << uint32(0);
|
||||||
@@ -5964,30 +5963,17 @@ void Player::SendActionButtons(uint32 state) const
|
|||||||
sLog.outDetail("Action Buttons for '%u' spec '%u' Sent", GetGUIDLow(), m_activeSpec);
|
sLog.outDetail("Action Buttons for '%u' spec '%u' Sent", GetGUIDLow(), m_activeSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type, Player* player, bool msg)
|
bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type)
|
||||||
{
|
{
|
||||||
if (button >= MAX_ACTION_BUTTONS)
|
if (button >= MAX_ACTION_BUTTONS)
|
||||||
{
|
{
|
||||||
if (msg)
|
sLog.outError( "Action %u not added into button %u for player %s: button must be < %u", action, button, GetName(), MAX_ACTION_BUTTONS );
|
||||||
{
|
|
||||||
if (player)
|
|
||||||
sLog.outError( "Action %u not added into button %u for player %s: button must be < %u", action, button, player->GetName(), MAX_ACTION_BUTTONS );
|
|
||||||
else
|
|
||||||
sLog.outError( "Table `playercreateinfo_action` have action %u into button %u : button must be < %u", action, button, MAX_ACTION_BUTTONS );
|
|
||||||
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action >= MAX_ACTION_BUTTON_ACTION_VALUE)
|
if (action >= MAX_ACTION_BUTTON_ACTION_VALUE)
|
||||||
{
|
{
|
||||||
if (msg)
|
sLog.outError( "Action %u not added into button %u for player %s: action must be < %u", action, button, GetName(), MAX_ACTION_BUTTON_ACTION_VALUE );
|
||||||
{
|
|
||||||
if (player)
|
|
||||||
sLog.outError( "Action %u not added into button %u for player %s: action must be < %u", action, button, player->GetName(), MAX_ACTION_BUTTON_ACTION_VALUE );
|
|
||||||
else
|
|
||||||
sLog.outError( "Table `playercreateinfo_action` have action %u into button %u : action must be < %u", action, button, MAX_ACTION_BUTTON_ACTION_VALUE );
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5996,33 +5982,20 @@ bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type, Pl
|
|||||||
case ACTION_BUTTON_SPELL:
|
case ACTION_BUTTON_SPELL:
|
||||||
if (!sSpellStore.LookupEntry(action))
|
if (!sSpellStore.LookupEntry(action))
|
||||||
{
|
{
|
||||||
if (msg)
|
sLog.outError( "Spell action %u not added into button %u for player %s: spell not exist", action, button, GetName() );
|
||||||
{
|
|
||||||
if (player)
|
|
||||||
sLog.outError( "Spell action %u not added into button %u for player %s: spell not exist", action, button, player->GetName() );
|
|
||||||
else
|
|
||||||
sLog.outError( "Table `playercreateinfo_action` have spell action %u into button %u: spell not exist", action, button );
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player && !player->HasSpell(action))
|
if (!HasSpell(action))
|
||||||
{
|
{
|
||||||
if (msg)
|
sLog.outError( "Spell action %u not added into button %u for player %s: player don't known this spell", action, button, GetName() );
|
||||||
sLog.outError( "Spell action %u not added into button %u for player %s: player don't known this spell", action, button, player->GetName() );
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ACTION_BUTTON_ITEM:
|
case ACTION_BUTTON_ITEM:
|
||||||
if (!ObjectMgr::GetItemPrototype(action))
|
if (!objmgr.GetItemPrototype(action))
|
||||||
{
|
{
|
||||||
if (msg)
|
sLog.outError( "Item action %u not added into button %u for player %s: item not exist", action, button, GetName() );
|
||||||
{
|
|
||||||
if (player)
|
|
||||||
sLog.outError( "Item action %u not added into button %u for player %s: item not exist", action, button, player->GetName() );
|
|
||||||
else
|
|
||||||
sLog.outError( "Table `playercreateinfo_action` have item action %u into button %u: item not exist", action, button );
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -6033,13 +6006,13 @@ bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type, Pl
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ActionButton* Player::addActionButton(uint8 spec, uint8 button, uint32 action, uint8 type)
|
ActionButton* Player::addActionButton(uint8 button, uint32 action, uint8 type)
|
||||||
{
|
{
|
||||||
if (spec == GetActiveSpec() && !IsActionButtonDataValid(button, action, type, this))
|
if (!IsActionButtonDataValid(button, action, type))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// it create new button (NEW state) if need or return existed
|
// it create new button (NEW state) if need or return existed
|
||||||
ActionButton& ab = m_actionButtons[spec][button];
|
ActionButton& ab = m_actionButtons[button];
|
||||||
|
|
||||||
// set data and update to CHANGED if not NEW
|
// set data and update to CHANGED if not NEW
|
||||||
ab.SetActionAndType(action,ActionButtonType(type));
|
ab.SetActionAndType(action,ActionButtonType(type));
|
||||||
@@ -6048,15 +6021,14 @@ ActionButton* Player::addActionButton(uint8 spec, uint8 button, uint32 action, u
|
|||||||
return &ab;
|
return &ab;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::removeActionButton(uint8 spec, uint8 button)
|
void Player::removeActionButton(uint8 button)
|
||||||
{
|
{
|
||||||
ActionButtonList& currentActionButtonList = m_actionButtons[spec];
|
ActionButtonList::iterator buttonItr = m_actionButtons.find(button);
|
||||||
ActionButtonList::iterator buttonItr = currentActionButtonList.find(button);
|
if (buttonItr == m_actionButtons.end() || buttonItr->second.uState == ACTIONBUTTON_DELETED)
|
||||||
if (buttonItr == currentActionButtonList.end() || buttonItr->second.uState == ACTIONBUTTON_DELETED)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (buttonItr->second.uState == ACTIONBUTTON_NEW)
|
if (buttonItr->second.uState == ACTIONBUTTON_NEW)
|
||||||
currentActionButtonList.erase(buttonItr); // new and not saved
|
m_actionButtons.erase(buttonItr); // new and not saved
|
||||||
else
|
else
|
||||||
buttonItr->second.uState = ACTIONBUTTON_DELETED; // saved, will deleted at next save
|
buttonItr->second.uState = ACTIONBUTTON_DELETED; // saved, will deleted at next save
|
||||||
|
|
||||||
@@ -6065,9 +6037,8 @@ void Player::removeActionButton(uint8 spec, uint8 button)
|
|||||||
|
|
||||||
ActionButton const* Player::GetActionButton(uint8 button)
|
ActionButton const* Player::GetActionButton(uint8 button)
|
||||||
{
|
{
|
||||||
ActionButtonList& currentActionButtonList = m_actionButtons[m_activeSpec];
|
ActionButtonList::iterator buttonItr = m_actionButtons.find(button);
|
||||||
ActionButtonList::iterator buttonItr = currentActionButtonList.find(button);
|
if (buttonItr == m_actionButtons.end() || buttonItr->second.uState == ACTIONBUTTON_DELETED)
|
||||||
if (buttonItr == currentActionButtonList.end() || buttonItr->second.uState == ACTIONBUTTON_DELETED)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return &buttonItr->second;
|
return &buttonItr->second;
|
||||||
@@ -16137,7 +16108,7 @@ bool Player::LoadFromDB(uint32 guid, SqlQueryHolder *holder)
|
|||||||
// update items with duration and realtime
|
// update items with duration and realtime
|
||||||
UpdateItemDuration(time_diff, true);
|
UpdateItemDuration(time_diff, true);
|
||||||
|
|
||||||
_LoadActions(holder->GetResult(PLAYER_LOGIN_QUERY_LOADACTIONS), true);
|
_LoadActions(holder->GetResult(PLAYER_LOGIN_QUERY_LOADACTIONS));
|
||||||
|
|
||||||
// unread mails and next delivery time, actual mails not loaded
|
// unread mails and next delivery time, actual mails not loaded
|
||||||
_LoadMailInit(holder->GetResult(PLAYER_LOGIN_QUERY_LOADMAILCOUNT), holder->GetResult(PLAYER_LOGIN_QUERY_LOADMAILDATE));
|
_LoadMailInit(holder->GetResult(PLAYER_LOGIN_QUERY_LOADMAILCOUNT), holder->GetResult(PLAYER_LOGIN_QUERY_LOADMAILDATE));
|
||||||
@@ -16298,29 +16269,28 @@ bool Player::isAllowedToLoot(const Creature* creature)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::_LoadActions(QueryResult_AutoPtr result, bool /*startup*/)
|
void Player::_LoadActions(QueryResult_AutoPtr result)
|
||||||
{
|
{
|
||||||
for (uint8 i = 0; i < MAX_TALENT_SPECS; ++i)
|
m_actionButtons.clear();
|
||||||
m_actionButtons[i].clear();
|
|
||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
Field *fields = result->Fetch();
|
Field *fields = result->Fetch();
|
||||||
uint8 spec = fields[0].GetUInt8();
|
|
||||||
uint8 button = fields[1].GetUInt8();
|
|
||||||
uint32 action = fields[2].GetUInt32();
|
|
||||||
uint8 type = fields[3].GetUInt8();
|
|
||||||
|
|
||||||
if (ActionButton* ab = addActionButton(spec, button, action, type))
|
uint8 button = fields[0].GetUInt8();
|
||||||
|
uint32 action = fields[1].GetUInt32();
|
||||||
|
uint8 type = fields[2].GetUInt8();
|
||||||
|
|
||||||
|
if (ActionButton* ab = addActionButton(button, action, type))
|
||||||
ab->uState = ACTIONBUTTON_UNCHANGED;
|
ab->uState = ACTIONBUTTON_UNCHANGED;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sLog.outError(" ...at loading, and will deleted in DB also");
|
sLog.outError(" ...at loading, and will deleted in DB also");
|
||||||
|
|
||||||
// Will deleted in DB at next save (it can create data until save but marked as deleted)
|
// Will deleted in DB at next save (it can create data until save but marked as deleted)
|
||||||
m_actionButtons[spec][button].uState = ACTIONBUTTON_DELETED;
|
m_actionButtons[button].uState = ACTIONBUTTON_DELETED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (result->NextRow());
|
while (result->NextRow());
|
||||||
@@ -17583,32 +17553,29 @@ void Player::SaveGoldToDB()
|
|||||||
|
|
||||||
void Player::_SaveActions()
|
void Player::_SaveActions()
|
||||||
{
|
{
|
||||||
for (uint8 i = 0; i < MAX_TALENT_SPECS; ++i)
|
for (ActionButtonList::iterator itr = m_actionButtons.begin(); itr != m_actionButtons.end();)
|
||||||
{
|
{
|
||||||
for (ActionButtonList::iterator itr = m_actionButtons[i].begin(); itr != m_actionButtons[i].end();)
|
switch (itr->second.uState)
|
||||||
{
|
{
|
||||||
switch (itr->second.uState)
|
case ACTIONBUTTON_NEW:
|
||||||
{
|
CharacterDatabase.PExecute("INSERT INTO character_action (guid,spec,button,action,type) VALUES ('%u', '%u', '%u', '%u', '%u')",
|
||||||
case ACTIONBUTTON_NEW:
|
GetGUIDLow(), m_activeSpec, (uint32)itr->first, (uint32)itr->second.GetAction(), (uint32)itr->second.GetType());
|
||||||
CharacterDatabase.PExecute("INSERT INTO character_action (guid,spec,button,action,type) VALUES ('%u', '%u', '%u', '%u', '%u')",
|
itr->second.uState = ACTIONBUTTON_UNCHANGED;
|
||||||
GetGUIDLow(), i, (uint32)itr->first, (uint32)itr->second.GetAction(), (uint32)itr->second.GetType());
|
++itr;
|
||||||
itr->second.uState = ACTIONBUTTON_UNCHANGED;
|
break;
|
||||||
++itr;
|
case ACTIONBUTTON_CHANGED:
|
||||||
break;
|
CharacterDatabase.PExecute("UPDATE character_action SET action = '%u', type = '%u' WHERE guid = '%u' AND button = '%u' AND spec = '%u'",
|
||||||
case ACTIONBUTTON_CHANGED:
|
(uint32)itr->second.GetAction(), (uint32)itr->second.GetType(), GetGUIDLow(), (uint32)itr->first, m_activeSpec);
|
||||||
CharacterDatabase.PExecute("UPDATE character_action SET action = '%u', type = '%u' WHERE guid = '%u' AND button = '%u' AND spec = '%u'",
|
itr->second.uState = ACTIONBUTTON_UNCHANGED;
|
||||||
(uint32)itr->second.GetAction(), (uint32)itr->second.GetType(), GetGUIDLow(), (uint32)itr->first, i);
|
++itr;
|
||||||
itr->second.uState = ACTIONBUTTON_UNCHANGED;
|
break;
|
||||||
++itr;
|
case ACTIONBUTTON_DELETED:
|
||||||
break;
|
CharacterDatabase.PExecute("DELETE FROM character_action WHERE guid = '%u' and button = '%u' and spec = '%u'", GetGUIDLow(), (uint32)itr->first, m_activeSpec);
|
||||||
case ACTIONBUTTON_DELETED:
|
m_actionButtons.erase(itr++);
|
||||||
CharacterDatabase.PExecute("DELETE FROM character_action WHERE guid = '%u' and button = '%u' and spec = '%u'", GetGUIDLow(), (uint32)itr->first, i);
|
break;
|
||||||
m_actionButtons[i].erase(itr++);
|
default:
|
||||||
break;
|
++itr;
|
||||||
default:
|
break;
|
||||||
++itr;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23413,26 +23380,18 @@ void Player::UpdateSpecCount(uint8 count)
|
|||||||
// Copy spec data
|
// Copy spec data
|
||||||
if (count > curCount)
|
if (count > curCount)
|
||||||
{
|
{
|
||||||
ActionButtonList const& currentActionButtonList = m_actionButtons[m_activeSpec];
|
_SaveActions(); // make sure the button list is cleaned up
|
||||||
for (ActionButtonList::const_iterator itr = currentActionButtonList.begin(); itr != currentActionButtonList.end(); ++itr)
|
for (ActionButtonList::iterator itr = m_actionButtons.begin(); itr != m_actionButtons.end(); ++itr)
|
||||||
{
|
CharacterDatabase.PExecute("INSERT INTO character_action (guid,button,action,type,spec) VALUES ('%u', '%u', '%u', '%u', '%u')",
|
||||||
if (itr->second.uState != ACTIONBUTTON_DELETED)
|
GetGUIDLow(), uint32(itr->first), uint32(itr->second.GetAction()), uint32(itr->second.GetType()), 1);
|
||||||
{
|
|
||||||
for (uint8 spec = curCount; spec < count; ++spec)
|
|
||||||
addActionButton(spec, itr->first, itr->second.GetAction(), itr->second.GetType());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Delete spec data for removed spec.
|
// Delete spec data for removed spec.
|
||||||
else if (count < curCount)
|
else if (count < curCount)
|
||||||
{
|
{
|
||||||
// Delete action buttons for removed spec
|
_SaveActions();
|
||||||
for (uint8 spec = count; spec < curCount; ++spec)
|
CharacterDatabase.PExecute("DELETE FROM character_action WHERE spec<>'%u' AND guid='%u'",m_activeSpec, GetGUIDLow());
|
||||||
{
|
m_activeSpec = 0;
|
||||||
// Delete action buttons for removed spec
|
|
||||||
for (uint8 button = 0; button < MAX_ACTION_BUTTONS; ++button)
|
|
||||||
removeActionButton(spec,button);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -23457,7 +23416,7 @@ void Player::ActivateSpec(uint8 spec)
|
|||||||
if (IsNonMeleeSpellCasted(false))
|
if (IsNonMeleeSpellCasted(false))
|
||||||
InterruptNonMeleeSpells(false);
|
InterruptNonMeleeSpells(false);
|
||||||
|
|
||||||
SetActiveSpec(spec);
|
_SaveActions();
|
||||||
|
|
||||||
UnsummonPetTemporaryIfAny();
|
UnsummonPetTemporaryIfAny();
|
||||||
ClearComboPointHolders();
|
ClearComboPointHolders();
|
||||||
@@ -23473,7 +23432,7 @@ void Player::ActivateSpec(uint8 spec)
|
|||||||
|
|
||||||
// Let client clear his current Actions
|
// Let client clear his current Actions
|
||||||
SendActionButtons(2);
|
SendActionButtons(2);
|
||||||
|
// m_actionButtons.clear() is called in the next _LoadActionButtons
|
||||||
for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i)
|
for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i)
|
||||||
{
|
{
|
||||||
TalentEntry const *talentInfo = sTalentStore.LookupEntry(i);
|
TalentEntry const *talentInfo = sTalentStore.LookupEntry(i);
|
||||||
@@ -23516,6 +23475,7 @@ void Player::ActivateSpec(uint8 spec)
|
|||||||
if (GlyphPropertiesEntry const *old_gp = sGlyphPropertiesStore.LookupEntry(oldglyph))
|
if (GlyphPropertiesEntry const *old_gp = sGlyphPropertiesStore.LookupEntry(oldglyph))
|
||||||
RemoveAurasDueToSpell(old_gp->SpellId);
|
RemoveAurasDueToSpell(old_gp->SpellId);
|
||||||
|
|
||||||
|
SetActiveSpec(spec);
|
||||||
uint32 spentTalents = 0;
|
uint32 spentTalents = 0;
|
||||||
|
|
||||||
for (uint32 talentId = 0; talentId < sTalentStore.GetNumRows(); ++talentId)
|
for (uint32 talentId = 0; talentId < sTalentStore.GetNumRows(); ++talentId)
|
||||||
@@ -23565,12 +23525,10 @@ void Player::ActivateSpec(uint8 spec)
|
|||||||
m_usedTalentCount = spentTalents;
|
m_usedTalentCount = spentTalents;
|
||||||
InitTalentForLevel();
|
InitTalentForLevel();
|
||||||
|
|
||||||
ActionButtonList const& currentActionButtonList = m_actionButtons[m_activeSpec];
|
if (QueryResult_AutoPtr result =
|
||||||
for (ActionButtonList::const_iterator itr = currentActionButtonList.begin(); itr != currentActionButtonList.end(); ++itr)
|
CharacterDatabase.PQuery("SELECT button,action,type FROM character_action WHERE guid = '%u' AND spec = '%u' ORDER BY button", GetGUIDLow(), m_activeSpec))
|
||||||
if (itr->second.uState != ACTIONBUTTON_DELETED)
|
_LoadActions(result);
|
||||||
// remove broken without any output (it can be not correct because talents not copied at spec creating)
|
|
||||||
if (!IsActionButtonDataValid(itr->first, itr->second.GetAction(), itr->second.GetType(), this, false))
|
|
||||||
removeActionButton(m_activeSpec, itr->first);
|
|
||||||
|
|
||||||
ResummonPetTemporaryUnSummonedIfAny();
|
ResummonPetTemporaryUnSummonedIfAny();
|
||||||
SendActionButtons(1);
|
SendActionButtons(1);
|
||||||
|
|||||||
+5
-5
@@ -1665,13 +1665,13 @@ class Player : public Unit, public GridObject<Player>
|
|||||||
m_cinematic = cine;
|
m_cinematic = cine;
|
||||||
}
|
}
|
||||||
|
|
||||||
ActionButton* addActionButton(uint8 spec, uint8 button, uint32 action, uint8 type);
|
ActionButton* addActionButton(uint8 button, uint32 action, uint8 type);
|
||||||
void removeActionButton(uint8 spec, uint8 button);
|
void removeActionButton(uint8 button);
|
||||||
uint32 GetActionButtonSpell(uint8 button) const;
|
uint32 GetActionButtonSpell(uint8 button) const;
|
||||||
ActionButton const* GetActionButton(uint8 button);
|
ActionButton const* GetActionButton(uint8 button);
|
||||||
void SendInitialActionButtons() const { SendActionButtons(1); }
|
void SendInitialActionButtons() const { SendActionButtons(1); }
|
||||||
void SendActionButtons(uint32 state) const;
|
void SendActionButtons(uint32 state) const;
|
||||||
bool IsActionButtonDataValid(uint8 button, uint32 action, uint8 type, Player* player, bool msg = true);
|
bool IsActionButtonDataValid(uint8 button, uint32 action, uint8 type);
|
||||||
|
|
||||||
PvPInfo pvpInfo;
|
PvPInfo pvpInfo;
|
||||||
void UpdatePvPState(bool onlyFFA = false);
|
void UpdatePvPState(bool onlyFFA = false);
|
||||||
@@ -2382,7 +2382,7 @@ class Player : public Unit, public GridObject<Player>
|
|||||||
/*** LOAD SYSTEM ***/
|
/*** LOAD SYSTEM ***/
|
||||||
/*********************************************************/
|
/*********************************************************/
|
||||||
|
|
||||||
void _LoadActions(QueryResult_AutoPtr result, bool startup);
|
void _LoadActions(QueryResult_AutoPtr result);
|
||||||
void _LoadAuras(QueryResult_AutoPtr result, uint32 timediff);
|
void _LoadAuras(QueryResult_AutoPtr result, uint32 timediff);
|
||||||
void _LoadGlyphAuras();
|
void _LoadGlyphAuras();
|
||||||
void _LoadBoundInstances(QueryResult_AutoPtr result);
|
void _LoadBoundInstances(QueryResult_AutoPtr result);
|
||||||
@@ -2483,7 +2483,7 @@ class Player : public Unit, public GridObject<Player>
|
|||||||
|
|
||||||
uint32 m_Glyphs[MAX_TALENT_SPECS][MAX_GLYPH_SLOT_INDEX];
|
uint32 m_Glyphs[MAX_TALENT_SPECS][MAX_GLYPH_SLOT_INDEX];
|
||||||
|
|
||||||
ActionButtonList m_actionButtons[MAX_TALENT_SPECS];
|
ActionButtonList m_actionButtons;
|
||||||
|
|
||||||
float m_auraBaseMod[BASEMOD_END][MOD_END];
|
float m_auraBaseMod[BASEMOD_END][MOD_END];
|
||||||
int16 m_baseRatingValue[MAX_COMBAT_RATING];
|
int16 m_baseRatingValue[MAX_COMBAT_RATING];
|
||||||
|
|||||||
Reference in New Issue
Block a user