-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Way to make drawers public! (tested on area mod) #67
Way to make drawers public! (tested on area mod) #67
Conversation
local idef = core.registered_items[iname] | ||
if idef.groups.drawer_public == 1 then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idef
might be nil
when items are removed from the game. This is an edge-case, but yet a potential bug.
Also I suggest to move all protection checks to a local function so that on_rightclick
and on_punch
use the identical checks.
for _,itemStack in pairs(upgrades) do | ||
local iname = itemStack:get_name() | ||
local idef = core.registered_items[iname] | ||
if idef.groups.drawer_public == 1 then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if idef.groups.drawer_public == 1 then | |
if idef and idef.groups.drawer_public == 1 then |
for _,itemStack in pairs(upgrades) do | ||
local iname = itemStack:get_name() | ||
local idef = core.registered_items[iname] | ||
if idef.groups.drawer_public == 1 then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if idef.groups.drawer_public == 1 then | |
if idef and idef.groups.drawer_public == 1 then |
Have a look at my PR. |
No description provided.