Skip to content

Commit

Permalink
Merge pull request #2 from AntumDeluge/settings
Browse files Browse the repository at this point in the history
Replace deprecated methods
  • Loading branch information
FaceDeer committed May 13, 2017
2 parents 42d85a1 + 66b62f2 commit 5787956
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ local config = {}
local function setting(stype, name, default, description)
local value
if stype == "bool" then
value = minetest.setting_getbool(CONFIG_FILE_PREFIX..name)
value = minetest.settings:get_bool(CONFIG_FILE_PREFIX..name)
elseif stype == "string" then
value = minetest.setting_get(CONFIG_FILE_PREFIX..name)
value = minetest.settings:get(CONFIG_FILE_PREFIX..name)
elseif stype == "int" or stype == "float" then
value = tonumber(minetest.setting_get(CONFIG_FILE_PREFIX..name))
value = tonumber(minetest.settings:get(CONFIG_FILE_PREFIX..name))
end
if value == nil then
value = default
Expand Down Expand Up @@ -86,7 +86,7 @@ local function use_airtank(itemstack, user, pointed_thing, full_item)
user:set_breath(breath)
minetest.sound_play("airtanks_hiss", {pos = user:getpos(), gain = 0.5})

if (not minetest.setting_getbool("creative_mode")) or config.wear_in_creative then
if (not minetest.settings:get_bool("creative_mode")) or config.wear_in_creative then
local wdef = itemstack:get_definition()
itemstack:add_wear(65535/(wdef._airtank_uses-1))
if itemstack:get_count() == 0 then
Expand Down

0 comments on commit 5787956

Please sign in to comment.