Skip to content

Commit

Permalink
proper skybox check
Browse files Browse the repository at this point in the history
  • Loading branch information
naturefreshmilk committed Jan 31, 2020
1 parent 5d5d377 commit b73f24d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions fly.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ end
local player_can_fly = function(player)
local pos = player:get_pos()
for _, box in pairs(skybox.list) do
if pos.y > box.miny and pos.y < box.maxy then
-- height match found
if box.fly then
return true
end
break
local match = false
if box.miny and box.maxy then
match = pos.y > box.miny and pos.y < box.maxy
elseif type(box.match) == "function" then
match = box.match(player, pos)
end

if match and box.fly then
return true
end
end

Expand Down

0 comments on commit b73f24d

Please sign in to comment.