1
0
mirror of https://github.com/t-affeldt/regional_weather.git synced 2025-07-17 16:00:35 +02:00

Fix MTG warning, add configurability for lightning chances, nerf movement penalties

This commit is contained in:
Till Affeldt
2020-05-16 16:20:47 +02:00
parent e6f0067f3b
commit ffdbdf792e
4 changed files with 17 additions and 7 deletions

View File

@ -6,6 +6,7 @@ Expects an integer indicating a chance (between 0 and 1) for lightning to strike
]]
if not minetest.get_modpath("lightning") then return end
if regional_weather.settings.lightning == 0 then return end
local EFFECT_NAME = "regional_weather:lightning"
@ -46,7 +47,7 @@ local function handle_effect(player_data)
chance = chance + value - (chance * value)
end
local random = math.random()
if random <= chance then
if random <= chance * regional_weather.settings.lightning then
local player = minetest.get_player_by_name(playername)
local ppos = player:get_pos()
local position = choose_pos(ppos)