re-do settings

This commit is contained in:
sfan5 2019-10-17 16:09:23 +02:00 committed by texmex
parent 97e9e9024a
commit ef07773f1d

@ -1,32 +1,38 @@
-- Vars -- Vars
local speed = tonumber(minetest.settings:get ("sprint_speed")) or 1.3 local function setting_get(name, default)
local jump = tonumber(minetest.settings:get ("sprint_jump")) or 1.1 return minetest.settings:get(name) or default
local dir = minetest.settings:get_bool("sprint_forward_only") ~= false end
local particles = tonumber(minetest.settings:get ("sprint_particles")) or 2
local stamina = minetest.settings:get_bool("sprint_stamina") ~= false local speed = tonumber(setting_get("sprint_speed", "1.3"))
local stamina_drain = tonumber(minetest.settings:get ("sprint_stamina_drain")) or 2 local jump = tonumber(setting_get("sprint_jump", "1.1"))
local replenish = tonumber(minetest.settings:get ("sprint_stamina_replenish")) or 2 local dir = minetest.is_yes(setting_get("sprint_forward_only", "false"))
local starve = minetest.settings:get_bool("sprint_starve") ~= false local particles = tonumber(setting_get("sprint_particles", "2"))
local starve_drain = tonumber(minetest.settings:get ("sprint_starve_drain")) or 0.5 local stamina = minetest.is_yes(setting_get("sprint_stamina", "true"))
local starve_limit = tonumber(minetest.settings:get ("sprint_starve_limit")) or 6 local stamina_drain = tonumber(setting_get("sprint_stamina_drain", "2"))
local breath = minetest.settings:get_bool("sprint_breath") ~= false local replenish = tonumber(setting_get("sprint_stamina_replenish", "2"))
local breath_drain = tonumber(minetest.settings:get ("sprint_breath_drain")) or 1 local starve = minetest.is_yes(setting_get("sprint_starve", "true"))
local autohide = minetest.settings:get_bool("hudbars_autohide_stamina") ~= false local starve_drain = tonumber(setting_get("sprint_starve_drain", "0.5"))
local starve_limit = tonumber(setting_get("sprint_starve_limit", "6"))
local breath = minetest.is_yes(setting_get("sprint_breath", "true"))
local breath_drain = tonumber(setting_get("sprint_breath_drain", "1"))
local autohide = minetest.is_yes(setting_get("hudbards_autohide_stamina", "false"))
local sprint_timer_step = 0.5 local sprint_timer_step = 0.5
local sprint_timer = 0 local sprint_timer = 0
local mod_hudbars = minetest.get_modpath("hudbars") or false local mod_hudbars = minetest.get_modpath("hudbars") ~= nil
local mod_player_monoids = minetest.get_modpath("player_monoids") or false local mod_player_monoids = minetest.get_modpath("player_monoids") ~= nil
local mod_playerphysics = minetest.get_modpath("playerphysics") or false local mod_playerphysics = minetest.get_modpath("playerphysics") ~= nil
local starve
if minetest.get_modpath("hbhunger") then if starve then
starve = "hbhunger" if minetest.get_modpath("hbhunger") then
elseif minetest.get_modpath("hunger_ng") then starve = "hbhunger"
starve = "hunger_ng" elseif minetest.get_modpath("hunger_ng") then
else starve = "hunger_ng"
starve = false else
starve = false
end
end end
if minetest.settings:get_bool("creative_mode") then if minetest.settings:get_bool("creative_mode") then
starve = false starve = false