mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-26 04:21:07 +01:00
Code style for #1890
This commit is contained in:
parent
bca5033fb2
commit
0564121183
1 changed files with 14 additions and 15 deletions
|
@ -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"})
|
||||||
|
|
Loading…
Reference in a new issue