Code style for #1890

This commit is contained in:
iliekprogrammar 2021-11-12 02:28:27 +08:00
parent bca5033fb2
commit 0564121183
No known key found for this signature in database
GPG key ID: 8E7B20514DBCFBFA

View file

@ -134,9 +134,6 @@ minetest.register_on_player_hpchange(function(player, hp_change)
end end
end) end)
local food_tick_timers = {} -- one food_tick_timer per player, keys are the player-objects local food_tick_timers = {} -- one food_tick_timer per player, keys are the player-objects
minetest.register_globalstep(function(dtime) minetest.register_globalstep(function(dtime)
for _,player in pairs(minetest.get_connected_players()) do for _,player in pairs(minetest.get_connected_players()) do
@ -158,7 +155,9 @@ minetest.register_globalstep(function(dtime)
end end
elseif food_level == 0 then -- starvation elseif food_level == 0 then -- starvation
local maximum_starvation = 1 --the amount of health at which a player will stop to get harmed by starvation (10 for Easy, 1 for Normal, 0 for Hard) -- the amount of health at which a player will stop to get
-- harmed by starvation (10 for Easy, 1 for Normal, 0 for Hard)
local maximum_starvation = 1
-- TODO: implement Minecraft-like difficulty modes and the update maximumStarvation here -- TODO: implement Minecraft-like difficulty modes and the update maximumStarvation here
if player_health > maximum_starvation then if player_health > maximum_starvation then
mcl_util.deal_damage(player, 1, {type = "starve"}) mcl_util.deal_damage(player, 1, {type = "starve"})