Use new setting functions

This commit is contained in:
Hybrid Dog 2017-06-18 12:09:12 +02:00
parent f7b048a851
commit 812b0f977e
3 changed files with 5 additions and 5 deletions

View File

@ -6,13 +6,13 @@
-- Quite a bit of trial-and-error learning here and it boiled down to a
-- small handful of code lines making the difference. ~ LazyJ
local creative_mode = minetest.setting_getbool("creative_mode")
local creative_mode = minetest.settings:get_bool"creative_mode"
local snowball_velocity, entity_attack_delay
local function update_snowball_vel(v)
snowball_velocity = v
local walkspeed = tonumber(minetest.setting_get("movement_speed_walk")) or 4
local walkspeed = tonumber(minetest.settings:get"movement_speed_walk") or 4
entity_attack_delay = (walkspeed+1)/v
end
update_snowball_vel(snow.snowball_velocity)
@ -27,7 +27,7 @@ snow.register_on_configuring(function(name, v)
end)
local function get_gravity()
local grav = tonumber(minetest.setting_get("movement_gravity")) or 9.81
local grav = tonumber(minetest.settings:get"movement_gravity") or 9.81
return grav*snowball_gravity
end

View File

@ -36,7 +36,7 @@ There is one in each of the "stairsplus.register_all" sections.
-- Check for infinite stacks
--if minetest.get_modpath("unified_inventory") or not minetest.setting_getbool("creative_mode") then
--if minetest.get_modpath("unified_inventory") or not minetest.settigetbool("creative_mode") then
-- snow_stairsplus.expect_infinite_stacks = false
--else
-- snow_stairsplus.expect_infinite_stacks = true

View File

@ -132,7 +132,7 @@ end
for i,v in pairs(snow) do
if allowed_types[type(v)] then
local v = minetest.setting_get("snow_"..i)
local v = minetest.settings:get("snow_"..i)
if v ~= nil then
snow[i] = value_from_string(v)
end