summaryrefslogtreecommitdiff
path: root/entities
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-04-20 01:12:47 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-04-20 01:12:47 -0400
commitaf73f004c2d15d4b69d4706f79948f52f45fe287 (patch)
tree4ad4233f388cb8dc256d0e28673a83ee62996324 /entities
parent573c19a5535deef9e015f0655fb495d91bac86a3 (diff)
downloadgmstranded-af73f004c2d15d4b69d4706f79948f52f45fe287.tar.gz
gmstranded-af73f004c2d15d4b69d4706f79948f52f45fe287.tar.bz2
gmstranded-af73f004c2d15d4b69d4706f79948f52f45fe287.zip
Buildsites fixed so they determine if a player is in the build site correctly
Diffstat (limited to 'entities')
-rw-r--r--entities/entities/gms_buildsite.lua4
1 files changed, 1 insertions, 3 deletions
diff --git a/entities/entities/gms_buildsite.lua b/entities/entities/gms_buildsite.lua
index 5fb4698..919c725 100644
--- a/entities/entities/gms_buildsite.lua
+++ b/entities/entities/gms_buildsite.lua
@@ -77,10 +77,8 @@ function ENT:OnUse( ply )
-- Prevent fools from trapping other players inside just-built structures/props
for id, ply in pairs( player.GetAll() ) do
- local mindist = self:OBBMaxs() - self:OBBMins()
- mindist = ( mindist.x + mindist.y + mindist.z ) / 3
- if ( ply:GetPos():Distance( self:LocalToWorld( self:OBBCenter() ) ) < mindist ) then
+ if ( ply:GetPos():WithinAABox(self:GetPhysicsObject():GetAABB()) ) then
ply:SendMessage( "Too close to other players!", 3, Color( 200, 10, 10, 255 ) )
return
end