mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 10:31:06 +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
1 changed files with 4 additions and 0 deletions
|
@ -10,6 +10,10 @@ mcl_weather.thunder = {
|
|||
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)
|
||||
if mcl_weather.get_weather() ~= "thunder" then
|
||||
return false
|
||||
|
|
Loading…
Reference in a new issue