diff options
Diffstat (limited to 'boost_cart/init.lua')
-rw-r--r-- | boost_cart/init.lua | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/boost_cart/init.lua b/boost_cart/init.lua index 9bcd785..1b2afa2 100644 --- a/boost_cart/init.lua +++ b/boost_cart/init.lua @@ -3,18 +3,22 @@ boost_cart = {} boost_cart.modpath = minetest.get_modpath("boost_cart") --- Settings glue for <= 0.4.15 -local setting_getter = minetest.setting_get -if minetest.settings then - setting_getter = function (key) - return minetest.settings:get(key) - end +if not minetest.settings then + error("[boost_cart] Your Minetest version is no longer supported." + .. " (Version <= 0.4.15)") +end + +local function getNum(setting) + return tonumber(minetest.settings:get(setting)) end -- Maximal speed of the cart in m/s -boost_cart.speed_max = tonumber(setting_getter("boost_cart.speed_max")) or 10 +boost_cart.speed_max = getNum("boost_cart.speed_max") or 10 -- Set to -1 to disable punching the cart from inside -boost_cart.punch_speed_max = tonumber(setting_getter("boost_cart.punch_speed_max")) or 7 +boost_cart.punch_speed_max = getNum("boost_cart.punch_speed_max") or 7 +-- Maximal distance for the path correction (for dtime peaks) +boost_cart.path_distance_max = 3 + -- Support for non-default games if not default.player_attached then |