From 1bd88829f2d11f4f87185241007178f38d65b0fa Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sat, 24 Sep 2022 13:36:51 -0400 Subject: [PATCH] Core/Player: Allow companion action buttons to be saved Port From (https://github.com/TrinityCore/TrinityCore/commit/e15898bf560fc8159777a2a29a29d6a91ffdb590) --- Source/Framework/Constants/PlayerConst.cs | 1 + Source/Game/Entities/Player/Player.cs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/Source/Framework/Constants/PlayerConst.cs b/Source/Framework/Constants/PlayerConst.cs index d59f2d5bc..3e87cb6cb 100644 --- a/Source/Framework/Constants/PlayerConst.cs +++ b/Source/Framework/Constants/PlayerConst.cs @@ -330,6 +330,7 @@ namespace Framework.Constants Dropdown = 0x30, Macro = 0x40, CMacro = C | Macro, + Companion = 0x50, Mount = 0x60, Item = 0x80 } diff --git a/Source/Game/Entities/Player/Player.cs b/Source/Game/Entities/Player/Player.cs index 721ebf9c6..3582a4bd3 100644 --- a/Source/Game/Entities/Player/Player.cs +++ b/Source/Game/Entities/Player/Player.cs @@ -1363,6 +1363,15 @@ namespace Game.Entities return false; } break; + case ActionButtonType.Companion: + { + if (GetSession().GetBattlePetMgr().GetPet(ObjectGuid.Create(HighGuid.BattlePet, action)) == null) + { + Log.outError(LogFilter.Player, $"Player::IsActionButtonDataValid: Companion action {action} not added into button {button} for player {GetName()} ({GetGUID()}): companion does not exist"); + return false; + } + break; + } case ActionButtonType.Mount: var mount = CliDB.MountStorage.LookupByKey(action); if (mount == null)