Detect accidental global sound playing
Every sound in the game (and all known mods for it) should play either at a specific location, to a specific player (e.g. chat beeps or notifications), or bound to a specific physical object. Detect any that might be played globally by accident, e.g. like a bug that existed in NC ZipRunes for a while, to aid in debugging.
This commit is contained in:
parent
0cc42fef14
commit
553893b60a
15
mods/nc_api/compat_soundpos.lua
Normal file
15
mods/nc_api/compat_soundpos.lua
Normal file
@ -0,0 +1,15 @@
|
||||
-- LUALOCALS < ---------------------------------------------------------
|
||||
local minetest, string
|
||||
= minetest, string
|
||||
local string_format
|
||||
= string.format
|
||||
-- LUALOCALS > ---------------------------------------------------------
|
||||
|
||||
local oldplay = minetest.sound_play
|
||||
function minetest.sound_play(spec, params, ...)
|
||||
if not (params and (params.pos or params.to_player or params.object)) then
|
||||
minetest.log("warning", string_format("global sound %q params %s",
|
||||
spec, minetest.serialize(params)))
|
||||
end
|
||||
return oldplay(spec, params, ...)
|
||||
end
|
@ -91,6 +91,7 @@ include("compat_issue10127")
|
||||
include("compat_legacyent")
|
||||
include("compat_nodealpha")
|
||||
include("compat_authcache")
|
||||
include("compat_soundpos")
|
||||
|
||||
include("util_settings")
|
||||
include("util_privs")
|
||||
|
Loading…
x
Reference in New Issue
Block a user