fix #2 rain/snow particles appears underwater

This commit is contained in:
Artūras Norkus 2016-02-11 14:00:26 +02:00
parent 97bdd3ce17
commit f98d46f68b
2 changed files with 12 additions and 0 deletions

View File

@ -103,6 +103,12 @@ minetest.register_globalstep(function(dtime)
if weather.state ~= "rain" then return end
for _, player in ipairs(minetest.get_connected_players()) do
local ppos = player:getpos()
local offset = player:get_eye_offset()
local player_eye_pos = {x = ppos.x + offset.x, y = ppos.y+offset.y + 1.5, z = ppos.z+offset.z}
if minetest.get_node_level(player_eye_pos) == 8 then
return false
end
local rain_nearby = rain.add_short_range_particlespawner(player)
local rain_distant = rain.add_long_range_particlespawner(player)

View File

@ -4,6 +4,12 @@ minetest.register_globalstep(function(dtime)
if weather.state ~= "snow" then return end
for _, player in ipairs(minetest.get_connected_players()) do
local ppos = player:getpos()
local offset = player:get_eye_offset()
local player_eye_pos = {x = ppos.x + offset.x, y = ppos.y+offset.y + 1.5, z = ppos.z+offset.z}
if minetest.get_node_level(player_eye_pos) == 8 then
return false
end
add_long_range_particlespawner(player)
end