Remove settings legacy, require 0.4.15-dev or newer

This commit is contained in:
SmallJoker 2017-10-03 08:35:20 +02:00
parent e8119a63cd
commit 2229ededa5
2 changed files with 7 additions and 9 deletions

View File

@ -376,7 +376,7 @@ if not boost_cart.mtg_compat then
return
end
if not minetest.setting_getbool("creative_mode") then
if not minetest.settings:get_bool("creative_mode") then
itemstack:take_item()
end
return itemstack

View File

@ -3,18 +3,16 @@ 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
-- 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 = tonumber(minetest.settings:get("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 =
tonumber(minetest.settings:get("boost_cart.punch_speed_max")) or 7
-- Support for non-default games
if not default.player_attached then