1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-12-22 23:10:17 +01:00

Avoid using the global 'table' as a function argument name

Co-authored-by: José Douglas da Silva Souza <44056294+JoseDouglas26@users.noreply.github.com>
This commit is contained in:
1F616EMO~nya 2024-06-17 02:08:42 +08:00 committed by GitHub
parent 511619253f
commit 82b017af6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,149 +2,149 @@
-- Sounds -- Sounds
-- --
function default.node_sound_defaults(table) function default.node_sound_defaults(tbl)
table = table or {} tbl = tbl or {}
table.footstep = table.footstep or tbl.footstep = tbl.footstep or
{name = "", gain = 1.0} {name = "", gain = 1.0}
table.dug = table.dug or tbl.dug = tbl.dug or
{name = "default_dug_node", gain = 0.25} {name = "default_dug_node", gain = 0.25}
table.place = table.place or tbl.place = tbl.place or
{name = "default_place_node_hard", gain = 1.0} {name = "default_place_node_hard", gain = 1.0}
return table return tbl
end end
function default.node_sound_stone_defaults(table) function default.node_sound_stone_defaults(tbl)
table = table or {} tbl = tbl or {}
table.footstep = table.footstep or tbl.footstep = tbl.footstep or
{name = "default_hard_footstep", gain = 0.2} {name = "default_hard_footstep", gain = 0.2}
table.dug = table.dug or tbl.dug = tbl.dug or
{name = "default_hard_footstep", gain = 1.0} {name = "default_hard_footstep", gain = 1.0}
default.node_sound_defaults(table) default.node_sound_defaults(tbl)
return table return tbl
end end
function default.node_sound_dirt_defaults(table) function default.node_sound_dirt_defaults(tbl)
table = table or {} tbl = tbl or {}
table.footstep = table.footstep or tbl.footstep = tbl.footstep or
{name = "default_dirt_footstep", gain = 0.25} {name = "default_dirt_footstep", gain = 0.25}
table.dig = table.dig or tbl.dig = tbl.dig or
{name = "default_dig_crumbly", gain = 0.4} {name = "default_dig_crumbly", gain = 0.4}
table.dug = table.dug or tbl.dug = tbl.dug or
{name = "default_dirt_footstep", gain = 1.0} {name = "default_dirt_footstep", gain = 1.0}
table.place = table.place or tbl.place = tbl.place or
{name = "default_place_node", gain = 1.0} {name = "default_place_node", gain = 1.0}
default.node_sound_defaults(table) default.node_sound_defaults(tbl)
return table return tbl
end end
function default.node_sound_sand_defaults(table) function default.node_sound_sand_defaults(tbl)
table = table or {} tbl = tbl or {}
table.footstep = table.footstep or tbl.footstep = tbl.footstep or
{name = "default_sand_footstep", gain = 0.05} {name = "default_sand_footstep", gain = 0.05}
table.dug = table.dug or tbl.dug = tbl.dug or
{name = "default_sand_footstep", gain = 0.15} {name = "default_sand_footstep", gain = 0.15}
table.place = table.place or tbl.place = tbl.place or
{name = "default_place_node", gain = 1.0} {name = "default_place_node", gain = 1.0}
default.node_sound_defaults(table) default.node_sound_defaults(tbl)
return table return tbl
end end
function default.node_sound_gravel_defaults(table) function default.node_sound_gravel_defaults(tbl)
table = table or {} tbl = tbl or {}
table.footstep = table.footstep or tbl.footstep = tbl.footstep or
{name = "default_gravel_footstep", gain = 0.25} {name = "default_gravel_footstep", gain = 0.25}
table.dig = table.dig or tbl.dig = tbl.dig or
{name = "default_gravel_dig", gain = 0.35} {name = "default_gravel_dig", gain = 0.35}
table.dug = table.dug or tbl.dug = tbl.dug or
{name = "default_gravel_dug", gain = 1.0} {name = "default_gravel_dug", gain = 1.0}
table.place = table.place or tbl.place = tbl.place or
{name = "default_place_node", gain = 1.0} {name = "default_place_node", gain = 1.0}
default.node_sound_defaults(table) default.node_sound_defaults(tbl)
return table return tbl
end end
function default.node_sound_wood_defaults(table) function default.node_sound_wood_defaults(tbl)
table = table or {} tbl = tbl or {}
table.footstep = table.footstep or tbl.footstep = tbl.footstep or
{name = "default_wood_footstep", gain = 0.15} {name = "default_wood_footstep", gain = 0.15}
table.dig = table.dig or tbl.dig = tbl.dig or
{name = "default_dig_choppy", gain = 0.4} {name = "default_dig_choppy", gain = 0.4}
table.dug = table.dug or tbl.dug = tbl.dug or
{name = "default_wood_footstep", gain = 1.0} {name = "default_wood_footstep", gain = 1.0}
default.node_sound_defaults(table) default.node_sound_defaults(tbl)
return table return tbl
end end
function default.node_sound_leaves_defaults(table) function default.node_sound_leaves_defaults(tbl)
table = table or {} tbl = tbl or {}
table.footstep = table.footstep or tbl.footstep = tbl.footstep or
{name = "default_grass_footstep", gain = 0.45} {name = "default_grass_footstep", gain = 0.45}
table.dug = table.dug or tbl.dug = tbl.dug or
{name = "default_grass_footstep", gain = 0.7} {name = "default_grass_footstep", gain = 0.7}
table.place = table.place or tbl.place = tbl.place or
{name = "default_place_node", gain = 1.0} {name = "default_place_node", gain = 1.0}
default.node_sound_defaults(table) default.node_sound_defaults(tbl)
return table return tbl
end end
function default.node_sound_glass_defaults(table) function default.node_sound_glass_defaults(tbl)
table = table or {} tbl = tbl or {}
table.footstep = table.footstep or tbl.footstep = tbl.footstep or
{name = "default_glass_footstep", gain = 0.3} {name = "default_glass_footstep", gain = 0.3}
table.dig = table.dig or tbl.dig = tbl.dig or
{name = "default_glass_footstep", gain = 0.5} {name = "default_glass_footstep", gain = 0.5}
table.dug = table.dug or tbl.dug = tbl.dug or
{name = "default_break_glass", gain = 1.0} {name = "default_break_glass", gain = 1.0}
default.node_sound_defaults(table) default.node_sound_defaults(tbl)
return table return tbl
end end
function default.node_sound_ice_defaults(table) function default.node_sound_ice_defaults(tbl)
table = table or {} tbl = tbl or {}
table.footstep = table.footstep or tbl.footstep = tbl.footstep or
{name = "default_ice_footstep", gain = 0.15} {name = "default_ice_footstep", gain = 0.15}
table.dig = table.dig or tbl.dig = tbl.dig or
{name = "default_ice_dig", gain = 0.5} {name = "default_ice_dig", gain = 0.5}
table.dug = table.dug or tbl.dug = tbl.dug or
{name = "default_ice_dug", gain = 0.5} {name = "default_ice_dug", gain = 0.5}
default.node_sound_defaults(table) default.node_sound_defaults(tbl)
return table return tbl
end end
function default.node_sound_metal_defaults(table) function default.node_sound_metal_defaults(tbl)
table = table or {} tbl = tbl or {}
table.footstep = table.footstep or tbl.footstep = tbl.footstep or
{name = "default_metal_footstep", gain = 0.2} {name = "default_metal_footstep", gain = 0.2}
table.dig = table.dig or tbl.dig = tbl.dig or
{name = "default_dig_metal", gain = 0.5} {name = "default_dig_metal", gain = 0.5}
table.dug = table.dug or tbl.dug = tbl.dug or
{name = "default_dug_metal", gain = 0.5} {name = "default_dug_metal", gain = 0.5}
table.place = table.place or tbl.place = tbl.place or
{name = "default_place_node_metal", gain = 0.5} {name = "default_place_node_metal", gain = 0.5}
default.node_sound_defaults(table) default.node_sound_defaults(tbl)
return table return tbl
end end
function default.node_sound_water_defaults(table) function default.node_sound_water_defaults(tbl)
table = table or {} tbl = tbl or {}
table.footstep = table.footstep or tbl.footstep = tbl.footstep or
{name = "default_water_footstep", gain = 0.2} {name = "default_water_footstep", gain = 0.2}
default.node_sound_defaults(table) default.node_sound_defaults(tbl)
return table return tbl
end end
function default.node_sound_snow_defaults(table) function default.node_sound_snow_defaults(tbl)
table = table or {} tbl = tbl or {}
table.footstep = table.footstep or tbl.footstep = tbl.footstep or
{name = "default_snow_footstep", gain = 0.2} {name = "default_snow_footstep", gain = 0.2}
table.dig = table.dig or tbl.dig = tbl.dig or
{name = "default_snow_footstep", gain = 0.3} {name = "default_snow_footstep", gain = 0.3}
table.dug = table.dug or tbl.dug = tbl.dug or
{name = "default_snow_footstep", gain = 0.3} {name = "default_snow_footstep", gain = 0.3}
table.place = table.place or tbl.place = tbl.place or
{name = "default_place_node", gain = 1.0} {name = "default_place_node", gain = 1.0}
default.node_sound_defaults(table) default.node_sound_defaults(tbl)
return table return tbl
end end