mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-28 13:53:45 +01:00
Stop lightning striking positions that don't have rain (#4386)
Stops lighting from being able to strike in locations where rain doesn't occur, but allows lightning in adjacent areas where is allowed. Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4386 Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land> Co-authored-by: teknomunk <teknomunk@protonmail.com> Co-committed-by: teknomunk <teknomunk@protonmail.com>
This commit is contained in:
parent
948da34755
commit
2ad59c6df9
@ -10,6 +10,10 @@ mcl_weather.thunder = {
|
|||||||
init_done = false,
|
init_done = false,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lightning.register_on_strike(function(pos, pos2, objects)
|
||||||
|
if not mcl_weather.has_rain(pos) then return nil, true end
|
||||||
|
end)
|
||||||
|
|
||||||
minetest.register_globalstep(function(dtime)
|
minetest.register_globalstep(function(dtime)
|
||||||
if mcl_weather.get_weather() ~= "thunder" then
|
if mcl_weather.get_weather() ~= "thunder" then
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user