Skip to content

Commit

Permalink
Fix default_stone_sounds undeclared global variable warnings (#59)
Browse files Browse the repository at this point in the history
* to fix these messages: <WARNING> 2024-04-04 01:04:37: [Main] Undeclared global variable "default_stone_sounds" accessed at .../moreores/init.lua:129

* to further drive the point home: luacheck is still happy
  • Loading branch information
imre84 committed Apr 4, 2024
1 parent 0d1e32c commit bf02115
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
5 changes: 0 additions & 5 deletions .luacheckrc
Expand Up @@ -3,11 +3,6 @@ unused_args = false
allow_defined_top = true
max_line_length = 90

ignore = {
"default_stone_sounds",
"default_metal_sounds"
}

stds.minetest = {
read_globals = {
"DIR_DELIM",
Expand Down
11 changes: 7 additions & 4 deletions init.lua
Expand Up @@ -33,12 +33,15 @@ local stone_ingredient = is_mcl_core_present and "mcl_core:stone" or "default:st
local copper_ingredient =
is_mcl_core_present and "mcl_copper:copper_ingot" or 'default:copper_ingot'
local default_stone_sounds
local default_metal_sounds
if is_mcl_sounds_present then
local default_stone_sounds = mcl_sounds.node_sound_stone_defaults()
local default_metal_sounds = mcl_sounds.node_sound_metal_defaults()
default_stone_sounds = mcl_sounds.node_sound_stone_defaults()
default_metal_sounds = mcl_sounds.node_sound_metal_defaults()
else
local default_stone_sounds = default.node_sound_stone_defaults()
local default_metal_sounds = default.node_sound_metal_defaults()
default_stone_sounds = default.node_sound_stone_defaults()
default_metal_sounds = default.node_sound_metal_defaults()
end
Expand Down

0 comments on commit bf02115

Please sign in to comment.