mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
Add strict module
Also fix leaking globals found by it.
This commit is contained in:
parent
6afdb22ba7
commit
a6ba042cf7
4 changed files with 51 additions and 3 deletions
|
@ -7,7 +7,7 @@
|
|||
function core.string_to_privs(str, delim)
|
||||
assert(type(str) == "string")
|
||||
delim = delim or ','
|
||||
privs = {}
|
||||
local privs = {}
|
||||
for _, priv in pairs(string.split(str, delim)) do
|
||||
privs[priv:trim()] = true
|
||||
end
|
||||
|
@ -17,7 +17,7 @@ end
|
|||
function core.privs_to_string(privs, delim)
|
||||
assert(type(privs) == "table")
|
||||
delim = delim or ','
|
||||
list = {}
|
||||
local list = {}
|
||||
for priv, bool in pairs(privs) do
|
||||
if bool then
|
||||
table.insert(list, priv)
|
||||
|
|
|
@ -56,7 +56,7 @@ core.register_entity(":__builtin:item", {
|
|||
item_texture = core.registered_items[itemname].inventory_image
|
||||
item_type = core.registered_items[itemname].type
|
||||
end
|
||||
prop = {
|
||||
local prop = {
|
||||
is_visible = true,
|
||||
visual = "wielditem",
|
||||
textures = {itemname},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue