From af73f004c2d15d4b69d4706f79948f52f45fe287 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Wed, 20 Apr 2016 01:12:47 -0400 Subject: Buildsites fixed so they determine if a player is in the build site correctly --- entities/entities/gms_buildsite.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'entities') 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 -- cgit v1.2.3-70-g09d2