filter: right interpret armor_use as wear-related %

This commit is contained in:
Alexander Weber 2017-04-02 21:35:29 +02:00
parent 5b163a6311
commit 0c59c0c36e
3 changed files with 6 additions and 4 deletions

View File

@ -18,7 +18,7 @@ return {
["group:armor:legs"] = { label = "Beinschutz" },
["group:armor:feet"] = { label = "Stiefel" },
["group:armor:shield"] = { label = "Schild" },
["group:armor:use"] = { label = "Maximaler Status" },
["group:armor:use"] = { label = "Abnutzung bei Schaden" },
-- http://dev.minetest.net/Groups
-- http://dev.minetest.net/Groups/Custom_groups

View File

@ -18,7 +18,7 @@ return {
["group:armor:legs"] = { label = "Legs protection" },
["group:armor:feet"] = { label = "Feet protection" },
["group:armor:shield"] = { label = "Shield" },
["group:armor:use"] = { label = "Max armor state" },
["group:armor:use"] = { label = "Wear on damage" },
-- http://dev.minetest.net/Groups
-- http://dev.minetest.net/Groups/Custom_groups

View File

@ -61,9 +61,11 @@ filter.register_filter({
else
mk = k
end
-- stack wear related value
if k == "armor_use" then
mv = tostring(math.floor(v / 65535 * 10000 + 0.5)/100).." %"
-- value-expandable groups
if v ~= 1 or k == "oddly_breakable_by_hand" then
elseif v ~= 1 or k == "oddly_breakable_by_hand" then
mv = v
else
mv = true