mirror of
https://repo.or.cz/minetest_hbarmor.git
synced 2025-06-30 07:10:41 +02:00
Change global variable names
This commit is contained in:
@ -5,18 +5,18 @@ minetest.after(0, function()
|
||||
end
|
||||
end)
|
||||
|
||||
function hud.get_armor(player)
|
||||
function hbarmor.get_armor(player)
|
||||
if not player or not armor.def then
|
||||
return
|
||||
end
|
||||
local name = player:get_player_name()
|
||||
local def = armor.def[name] or nil
|
||||
if def and def.state and def.count then
|
||||
hud.set_armor(name, def.state, def.count)
|
||||
hbarmor.set_armor(name, def.state, def.count)
|
||||
end
|
||||
end
|
||||
|
||||
function hud.set_armor(player_name, ges_state, items)
|
||||
function hbarmor.set_armor(player_name, ges_state, items)
|
||||
local max_items = 4
|
||||
if items == 5 then
|
||||
max_items = items
|
||||
@ -28,7 +28,7 @@ function hud.set_armor(player_name, ges_state, items)
|
||||
lvl = 0
|
||||
end
|
||||
|
||||
hud.armor[player_name] = lvl* (items * (100 / max_items))
|
||||
hbarmor.armor[player_name] = lvl* (items * (100 / max_items))
|
||||
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user