Core/Player: Allow companion action buttons to be saved

Port From (https://github.com/TrinityCore/TrinityCore/commit/e15898bf560fc8159777a2a29a29d6a91ffdb590)
This commit is contained in:
hondacrx
2022-09-24 13:36:51 -04:00
parent 44e9ff9793
commit 1bd88829f2
2 changed files with 10 additions and 0 deletions
@@ -330,6 +330,7 @@ namespace Framework.Constants
Dropdown = 0x30,
Macro = 0x40,
CMacro = C | Macro,
Companion = 0x50,
Mount = 0x60,
Item = 0x80
}
+9
View File
@@ -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)