move base altitude to setting and init

This commit is contained in:
Tai @ Flex 2016-12-05 03:53:07 +00:00
parent 84701d46b8
commit 37a65ba32f
2 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,5 @@
skytardis = {}
skytardis.base_altitude = minetest.setting_get("skytardis.base_altitude") or 100 -- should default to 31000 out of tests
local path = minetest.get_modpath("skytardis")
--dofile(path.."/abm.lua")

View File

@ -24,11 +24,10 @@ end
function skytardis:getSkyBoundsFor(landx,landz)
local bounds = skytardis:derive_blockbounds(landx,landz)
local base_altitude = 100 -- in prod, should be 31000
local increment = skytardis:derive_altitude(landx,landz)
bounds.pos1.y = base_altitude + increment
bounds.pos2.y = base_altitude + increment
bounds.pos1.y = skytardis.base_altitude + increment
bounds.pos2.y = skytardis.base_altitude + increment
return bounds
end