Skip to content

Commit

Permalink
Feed activator entity into the CanPlayerEnterDoor hook
Browse files Browse the repository at this point in the history
Useful if developers would like to do checks on the player before allowing them access to the TARDIS. For example in an RP scenario, if they are the right role.
  • Loading branch information
Ryan Maybury authored Sep 4, 2024
1 parent e0a28af commit 162bda2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/entities/gmod_tardis/modules/sv_interior.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ENT:AddHook("Use", "interior", function(self,a,c)
if a:KeyDown(IN_WALK) or not IsValid(self.interior) or self:GetData("legacy_door_type") then
if self:CallHook("CanPlayerEnterDoor")~=false then
if self:CallHook("CanPlayerEnterDoor", a)~=false then
self:PlayerEnter(a)
end
else
Expand Down Expand Up @@ -40,4 +40,4 @@ ENT:AddHook("OnRemove", "interior", function(self)
if IsValid(self.interior) then
self.interior.exterior_deleted = true
end
end)
end)

0 comments on commit 162bda2

Please sign in to comment.