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 +--- gamemode/init_static.lua | 4 ++++ 2 files changed, 5 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 diff --git a/gamemode/init_static.lua b/gamemode/init_static.lua index 5d5444f..6bd9e7f 100644 --- a/gamemode/init_static.lua +++ b/gamemode/init_static.lua @@ -1,3 +1,7 @@ +--[[ +This file loads in tree and barrow locations from a seperate file in gmstranded/content/data/map_static/whatever +]]-- + function loaddata(mapname, filename) local data = {} local filepath = "gamemodes/" .. GM.GAMEMODE_FOLDER_NAME .. "/content/data/map_static/" .. mapname .. "/" .. filename -- cgit v1.2.3-70-g09d2