Skip to content

Commit

Permalink
Fix ship ownership buff not working issue. (AAEmu#1094)
Browse files Browse the repository at this point in the history
* Fix ship ownership buff not working issue.

* Fix ship ownership buff not working issue.

---------

Co-authored-by: Mango <[email protected]>
  • Loading branch information
MangoXing and Mango authored Sep 8, 2024
1 parent f32a6a3 commit aa0a8a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions AAEmu.Game/Core/Managers/SlaveManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ public void BindSlave(Character character, uint objId, AttachPointKind attachPoi
if (slave == null || slave.AttachedCharacters.ContainsKey(attachPoint))
return;

// Check if the vehicle has the MasterOwnership buff and if the character is not the owner, block the attachment.
if (attachPoint == AttachPointKind.Driver && slave.Buffs.CheckBuff((uint)BuffConstants.MasterOwnership) && slave.Summoner.ObjId != character.ObjId)
{
character.SendErrorMessage(ErrorMessageType.SlaveAlreadyHasMaster); // 仅阻止驾驶座附加
return;
}

character.BroadcastPacket(new SCUnitAttachedPacket(character.ObjId, attachPoint, bondKind, objId), true);
character.AttachedPoint = attachPoint;
switch (attachPoint)
Expand Down
5 changes: 3 additions & 2 deletions AAEmu.Game/Models/Game/Skills/BuffConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public enum BuffConstants : uint
EquipTwoHanded = 8227,
InBeautySalon = 6117,
SearchSchoolOfFish = 5736,
Overburdened = 831 // SustainBuff - Carrying heavy objects reduces movement speed and prevents teleporting or gliding.
// Overburdened = 7221
Overburdened = 831, // SustainBuff - Carrying heavy objects reduces movement speed and prevents teleporting or gliding.
MasterOwnership = 4867 // Vehicle ownership buff, prevents non-owners from attaching to the vehicle.
// Overburdened = 7221
}

0 comments on commit aa0a8a3

Please sign in to comment.