Fix crash with food mod when in creative mode, fix player not unfreezing on auto wake

pull/2/head
Brandon 2014-05-25 23:48:57 -05:00
parent 2a4aecddae
commit cf474d752f
2 changed files with 3 additions and 2 deletions

View File

@ -193,7 +193,7 @@ function hud.set_armor()
end
if HUD_ENABLE_HUNGER then dofile(minetest.get_modpath("hud").."/hunger.lua") end
if HUD_ENABLE_HUNGER then dofile(minetest.get_modpath("hud").."/hunger.lua") else hud.item_eat = function () end end
if HUD_SHOW_ARMOR then dofile(minetest.get_modpath("hud").."/armor.lua") end
dofile(minetest.get_modpath("hud").."/stamina.lua")

View File

@ -7,7 +7,7 @@ player_sleephuds = {}
function hud.update_stamina(p,name)
-- loop through all online players and check their movement and update their stamina
local pos = p:getpos()
if player_lastpos[name] ~= nil then
if player_lastpos[name] ~= nil and skills.player_levels[name] ~= nil then
if player_stamina[name] ~= nil then
if minetest.check_player_privs(name, {immortal=true}) then
player_stamina[name] = 20
@ -54,6 +54,7 @@ function hud.update_stamina(p,name)
player_sleephuds[name] = nil
end
minetest.chat_send_player(name,"You feel fully energized!")
physics.unfreeze_player(name)
end
end
if player_stamina[name] < 3 then