Hunger no longer affects players with immortal privilege

pull/14/head
Brandon 2015-07-25 14:42:12 -05:00
parent 274f8eaad7
commit bb3551513c
2 changed files with 6 additions and 2 deletions

View File

@ -301,8 +301,8 @@ minetest.register_node("cottages:handmill", {
"list[current_name;flour;5,1;2,2;]"..
"label[0,0.5;"..S("Grind This:").."]"..
"label[4,0.5;"..S("Ground Object:").."]"..
"label[0,0.15;"..S("Mill").."]"..
"label[2.5,0.15;"..S("Owner: %s"):format(meta:get_string('owner') or "").."]"..
"label[0,0.1;"..S("Mill").."]"..
"label[2.5,0.1;"..S("Owner: %s"):format(meta:get_string('owner') or "").."]"..
"label[0,2.5;"..S("Punch this hand-driven mill").."]"..
"label[0,3.0;"..S("to grind various items.").."]"..
"list[current_player;main;0,4;8,4;]");

View File

@ -122,6 +122,10 @@ if minetest.setting_getbool("enable_damage") then
for _,player in ipairs(minetest.get_connected_players()) do
local name = player:get_player_name()
local tab = hunger[name]
if minetest.check_player_privs(name, {immortal=true}) then
update_hunger(player,20)
return
end
if tab then
local hunger = tab.lvl
if hunger > 0 then