mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[9378] Not report action button porblems at spec activation.
Action bar copied at spec creating and base at fact that talents not copied possible cases when action bars not apporpriate for created spec. So let its drop silencely
This commit is contained in:
parent
ec26a61b5d
commit
9509b11f38
3 changed files with 37 additions and 28 deletions
|
|
@ -5650,23 +5650,30 @@ void Player::SendInitialActionButtons() const
|
|||
sLog.outDetail( "Action Buttons for '%u' Initialized", GetGUIDLow() );
|
||||
}
|
||||
|
||||
bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type, Player* player)
|
||||
bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type, Player* player, bool msg)
|
||||
{
|
||||
if(button >= 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 );
|
||||
if (msg)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
if(action >= 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 );
|
||||
if (msg)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -5675,26 +5682,33 @@ bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type, Pl
|
|||
case ACTION_BUTTON_SPELL:
|
||||
if(!sSpellStore.LookupEntry(action))
|
||||
{
|
||||
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 );
|
||||
if (msg)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
if(player && !player->HasSpell(action))
|
||||
{
|
||||
sLog.outError( "Spell action %u not added into button %u for player %s: player don't known this spell", action, button, player->GetName() );
|
||||
if (msg)
|
||||
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;
|
||||
}
|
||||
break;
|
||||
case ACTION_BUTTON_ITEM:
|
||||
if(!ObjectMgr::GetItemPrototype(action))
|
||||
{
|
||||
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 );
|
||||
if (msg)
|
||||
{
|
||||
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;
|
||||
}
|
||||
break;
|
||||
|
|
@ -21407,8 +21421,9 @@ void Player::ActivateSpec(uint8 specNum)
|
|||
ActionButtonList const& currentActionButtonList = m_actionButtons[m_activeSpec];
|
||||
for(ActionButtonList::const_iterator itr = currentActionButtonList.begin(); itr != currentActionButtonList.end(); ++itr)
|
||||
if (itr->second.uState != ACTIONBUTTON_DELETED)
|
||||
if (!IsActionButtonDataValid(itr->first,itr->second.GetAction(),itr->second.GetType(), this))
|
||||
removeActionButton(m_activeSpec,itr->first);
|
||||
// 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);
|
||||
|
||||
ApplyGlyphAuras(true);
|
||||
|
||||
|
|
@ -21441,10 +21456,6 @@ void Player::UpdateSpecCount(uint8 count)
|
|||
addActionButton(spec,itr->first,itr->second.GetAction(),itr->second.GetType());
|
||||
}
|
||||
}
|
||||
|
||||
// other data copy
|
||||
// for(uint8 spec = curCount; spec < count; ++spec)
|
||||
// ...
|
||||
}
|
||||
// delete spec data for removed specs
|
||||
else if (count < curCount)
|
||||
|
|
@ -21455,8 +21466,6 @@ void Player::UpdateSpecCount(uint8 count)
|
|||
// delete action buttons for removed spec
|
||||
for(uint8 button = 0; button < MAX_ACTION_BUTTONS; ++button)
|
||||
removeActionButton(spec,button);
|
||||
|
||||
// other data remove
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue