Fix logic error due to operator precedence when checking item name (#8)

This commit is contained in:
fluxionary 2023-05-23 11:34:16 -07:00 committed by GitHub
parent 994c1a263d
commit 8085ab8988
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -339,7 +339,7 @@ local function ccompass_permitted_target(itemstack)
-- setting compasses when node type restriction is enabled.
return false
end
if not (itemstack:get_name():sub(1,ccompass_prefix_length) == ccompass_prefix) then
if itemstack:get_name():sub(1,ccompass_prefix_length) ~= ccompass_prefix then
return false
end
local meta = itemstack:get_meta()
@ -350,7 +350,7 @@ local function ccompass_permitted_target(itemstack)
return true
end
local function ccompass_permitted_source(itemstack)
if not itemstack:get_name():sub(1,ccompass_prefix_length) == ccompass_prefix then
if itemstack:get_name():sub(1,ccompass_prefix_length) ~= ccompass_prefix then
return false
end
local meta = itemstack:get_meta()