mirror of
https://codeberg.org/tenplus1/ambience.git
synced 2024-12-24 01:30:30 +01:00
Only play splashing sound when player is moving in shallow water
This commit is contained in:
parent
7d9aa0cd4b
commit
f80bb863ab
12
init.lua
12
init.lua
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
--= Ambience lite by TenPlus1 (6th June 2016)
|
--= Ambience lite by TenPlus1 (13th June 2016)
|
||||||
|
|
||||||
local max_frequency_all = 1000 -- larger number means more frequent sounds (100-2000)
|
local max_frequency_all = 1000 -- larger number means more frequent sounds (100-2000)
|
||||||
local SOUNDVOLUME = 1
|
local SOUNDVOLUME = 1
|
||||||
@ -131,9 +131,13 @@ local get_ambience = function(player)
|
|||||||
return {underwater = underwater}
|
return {underwater = underwater}
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.registered_nodes[nod_feet]
|
if minetest.registered_nodes[nod_feet].groups.water then
|
||||||
and minetest.registered_nodes[nod_feet].groups.water then
|
|
||||||
return {splash = splash}
|
local control = player:get_player_control()
|
||||||
|
|
||||||
|
if control.up or control.down or control.left or control.right then
|
||||||
|
return {splash = splash}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local ps, cn = minetest.find_nodes_in_area(
|
local ps, cn = minetest.find_nodes_in_area(
|
||||||
|
Loading…
Reference in New Issue
Block a user