]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Remove unused variable WARN_INIT
authorZughy <63455151+Zughy@users.noreply.github.com>
Sun, 8 May 2022 17:11:15 +0000 (19:11 +0200)
committerGitHub <noreply@github.com>
Sun, 8 May 2022 17:11:15 +0000 (19:11 +0200)
builtin/common/strict.lua

index ccde9676b3af202bbba0f13b6b11b306a0e70287..f46234dc6b9006a302f2ed7d516b7ceaf15bebd4 100644 (file)
@@ -1,8 +1,3 @@
-
--- Always warn when creating a global variable, even outside of a function.
--- This ignores mod namespaces (variables with the same name as the current mod).
-local WARN_INIT = false
-
 local getinfo = debug.getinfo
 
 function core.global_exists(name)
@@ -33,11 +28,6 @@ function meta:__newindex(name, value)
                end
                declared[name] = true
        end
-       -- Ignore mod namespaces
-       if WARN_INIT and name ~= core.get_current_modname() then
-               core.log("warning", ("Global variable %q created at %s.")
-                       :format(name, desc))
-       end
        rawset(self, name, value)
 end
 
@@ -54,4 +44,3 @@ function meta:__index(name)
 end
 
 setmetatable(_G, meta)
-