mirror of
https://gitlab.com/rautars/weather_pack.git
synced 2025-01-10 08:20:17 +01:00
fix #2 rain/snow particles appears underwater
This commit is contained in:
parent
97bdd3ce17
commit
f98d46f68b
@ -103,6 +103,12 @@ minetest.register_globalstep(function(dtime)
|
|||||||
if weather.state ~= "rain" then return end
|
if weather.state ~= "rain" then return end
|
||||||
for _, player in ipairs(minetest.get_connected_players()) do
|
for _, player in ipairs(minetest.get_connected_players()) do
|
||||||
local ppos = player:getpos()
|
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_nearby = rain.add_short_range_particlespawner(player)
|
||||||
local rain_distant = rain.add_long_range_particlespawner(player)
|
local rain_distant = rain.add_long_range_particlespawner(player)
|
||||||
|
@ -4,6 +4,12 @@ minetest.register_globalstep(function(dtime)
|
|||||||
if weather.state ~= "snow" then return end
|
if weather.state ~= "snow" then return end
|
||||||
for _, player in ipairs(minetest.get_connected_players()) do
|
for _, player in ipairs(minetest.get_connected_players()) do
|
||||||
local ppos = player:getpos()
|
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)
|
add_long_range_particlespawner(player)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user