Crickets and birds don't sing in rain
This commit is contained in:
parent
150c0a5627
commit
e370e71b37
@ -1 +1,2 @@
|
||||
default
|
||||
weather?
|
||||
|
@ -3,6 +3,8 @@
|
||||
-- By Kaadmy, for Pixture
|
||||
--
|
||||
|
||||
local mod_weather = minetest.get_modpath("weather")
|
||||
|
||||
ambiance = {}
|
||||
|
||||
ambiance.sounds = {}
|
||||
@ -16,6 +18,12 @@ ambiance.sounds["birds"] = {
|
||||
can_play = function(pos)
|
||||
local tod = (minetest.get_timeofday() or 1) * 2
|
||||
|
||||
if mod_weather then
|
||||
if weather.weather ~= "clear" then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
if tod > 0.47 and tod < 1.53 then -- bit of overlap into crickets
|
||||
return true
|
||||
end
|
||||
@ -33,6 +41,12 @@ ambiance.sounds["crickets"] = {
|
||||
can_play = function(pos)
|
||||
local tod = (minetest.get_timeofday() or 1) * 2
|
||||
|
||||
if mod_weather then
|
||||
if weather.weather ~= "clear" then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
if tod < 0.5 or tod > 1.5 then
|
||||
return true
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user