made hunger use conf settings for step

This commit is contained in:
kaadmy 2015-09-24 10:04:12 -07:00
parent 85459be525
commit a37151d82a
4 changed files with 2 additions and 1 deletions

View File

@ -47,6 +47,7 @@ testing_enable = false
# if hunger is enabled
hunger_enable = true
hunger_step = 2
# server
max_users = 16

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 B

After

Width:  |  Height:  |  Size: 308 B

View File

@ -14,7 +14,7 @@ hunger.saturation = {} -- how saturated with food the player is
local player_step = {}
local player_health_step = {}
local player_bar = {}
local base_interval = 1.5 -- seconds per hunger update, 1.5 is about ok
local base_interval = tonumber(minetest.setting_get("hunger_step")) or 2.0 -- seconds per hunger update, 1.5 is slightly fast
local file = minetest.get_worldpath() .. "/hunger"
function hunger.save_hunger()