Core/Player: Allow companion action buttons to be saved

This commit is contained in:
Meji
2022-09-17 23:54:43 +02:00
committed by Shauren
parent cbf2064c62
commit e15898bf56
2 changed files with 11 additions and 0 deletions

View File

@@ -6054,6 +6054,16 @@ bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type) co
return false;
}
break;
case ACTION_BUTTON_COMPANION:
{
if (!GetSession()->GetBattlePetMgr()->GetPet(ObjectGuid::Create<HighGuid::BattlePet>(action)))
{
TC_LOG_ERROR("entities.player", "Player::IsActionButtonDataValid: Companion action %u not added into button %u for player %s (%s): companion does not exist",
action, button, GetName().c_str(), GetGUID().ToString().c_str());
return false;
}
break;
}
case ACTION_BUTTON_MOUNT:
{
auto mount = sDB2Manager.GetMountById(action);

View File

@@ -312,6 +312,7 @@ enum ActionButtonType
ACTION_BUTTON_DROPDOWN = 0x30,
ACTION_BUTTON_MACRO = 0x40,
ACTION_BUTTON_CMACRO = ACTION_BUTTON_C | ACTION_BUTTON_MACRO,
ACTION_BUTTON_COMPANION = 0x50,
ACTION_BUTTON_MOUNT = 0x60,
ACTION_BUTTON_ITEM = 0x80
};