1
0
mirror of https://repo.or.cz/minetest_hbarmor.git synced 2025-06-30 07:10:41 +02:00

Add some error messages in case of failure

This commit is contained in:
Wuzzy
2015-02-24 07:02:35 +01:00
parent b169a0307d
commit 5947496935
2 changed files with 12 additions and 4 deletions

View File

@ -7,13 +7,16 @@ end)
function hbarmor.get_armor(player)
if not player or not armor.def then
return
return false
end
local name = player:get_player_name()
local def = armor.def[name] or nil
if def and def.state and def.count then
hbarmor.set_armor(name, def.state, def.count)
else
return false
end
return true
end
function hbarmor.set_armor(player_name, ges_state, items)