From d542042a5002c3c4737d55a0ca0bb7a3539a3766 Mon Sep 17 00:00:00 2001 From: Beha Date: Sat, 4 Apr 2020 17:38:25 -0400 Subject: [PATCH] Interpret group ratings of zero as not in group. The MT API docs instruct to interpret `nil` and `0` as the same rating. --- src/api_triggers.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api_triggers.lua b/src/api_triggers.lua index 454c79e..d763a05 100644 --- a/src/api_triggers.lua +++ b/src/api_triggers.lua @@ -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