Merge branch 'group_zero' into 'master'

Interpret group ratings of zero as not in group.

See merge request rubenwardy/awards!83
This commit is contained in:
Beha 2020-04-04 21:45:43 +00:00
commit d03c07bca3
1 changed files with 2 additions and 2 deletions

View File

@ -144,8 +144,8 @@ function awards.register_trigger(tname, tdef)
if tdef.key_is_item and key:sub(1, 6) ~= "group:" then
local itemdef = minetest.registered_items[key]
if itemdef then
for groupname, _ in pairs(itemdef.groups or {}) do
if tdef.watched_groups[groupname] then
for groupname,rating in pairs(itemdef.groups or {}) do
if rating ~= 0 and tdef.watched_groups[groupname] then
tdef.notify(player, "group:" .. groupname, n)
end
end