Skip to content

Commit

Permalink
More Hooker perrmission changes (#2019)
Browse files Browse the repository at this point in the history
  • Loading branch information
LtRipley36706 committed Jun 19, 2019
1 parent 79ed11d commit 860c56c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Source/ACE.Server/WorldObjects/Hooker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ public override ActivationResult CheckUseRequirements(WorldObject activator)
else if (Owner == null)
return new ActivationResult(false);

var wo = Owner.TryGetWorldObject();

if (wo == null)
return new ActivationResult(false);

if (!(wo is Hook hook))
return new ActivationResult(false);

if (!hook.HouseOwner.HasValue || hook.HouseOwner.Value == 0 || (!hook.House.OpenStatus && !hook.House.HasPermission(player)))
return new ActivationResult(new GameEventWeenieError(player.Session, WeenieError.YouAreNotPermittedToUseThatHook));

var baseRequirements = base.CheckUseRequirements(activator);
if (!baseRequirements.Success)
return baseRequirements;
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ACEmulator Change Log

### 2019-06-18
[Ripley]
* Prevent using Hookers if house isn't owned or is closed and player isn't on guestlist.

### 2019-06-17
[Ripley]
* Prevent using Hookers if they aren't hooked.
Expand Down

0 comments on commit 860c56c

Please sign in to comment.