diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-04-20 01:12:47 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-04-20 01:12:47 -0400 |
| commit | af73f004c2d15d4b69d4706f79948f52f45fe287 (patch) | |
| tree | 4ad4233f388cb8dc256d0e28673a83ee62996324 | |
| parent | 573c19a5535deef9e015f0655fb495d91bac86a3 (diff) | |
| download | gmstranded-af73f004c2d15d4b69d4706f79948f52f45fe287.tar.gz gmstranded-af73f004c2d15d4b69d4706f79948f52f45fe287.tar.bz2 gmstranded-af73f004c2d15d4b69d4706f79948f52f45fe287.zip | |
Buildsites fixed so they determine if a player is in the build site correctly
| -rw-r--r-- | entities/entities/gms_buildsite.lua | 4 | ||||
| -rw-r--r-- | 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 |
