Skip to content

Commit

Permalink
Block Fading Door/collide with world only
Browse files Browse the repository at this point in the history
  • Loading branch information
StyledStrike committed Dec 31, 2024
1 parent 49f118e commit acca364
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 10 additions & 0 deletions lua/entities/base_glide/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,16 @@ function ENT:Use( activator )
end
end

function ENT:CanTool( ply, trace, mode, tool, button )
-- Block collide with world only
if mode == "nocollide" and button == 2 then return false end

-- Block Fading Door
if mode == "fading_door" then return false end

return BaseClass.CanTool( self, ply, trace, mode, tool, button )
end

--- Sets the "EngineState" network variable to `1` and calls `ENT:OnTurnOn`.
function ENT:TurnOn()
if self:GetEngineHealth() > 0 then
Expand Down
6 changes: 0 additions & 6 deletions lua/entities/base_glide_tank/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,6 @@ function ENT:OnTakeDamage( dmginfo )
end
end

function ENT:CanTool( _ply, _trace, mode, _tool, button )
if mode == "nocollide" and button == 2 then return false end

return true
end

function ENT:GetTurretOrigin()
return self:LocalToWorld( self.TurretOffset )
end
Expand Down

0 comments on commit acca364

Please sign in to comment.