mirror of
https://github.com/t-affeldt/climate_api.git
synced 2025-03-22 17:32:23 +00:00
Fix crash when trying to apply weather to dead players
This commit is contained in:
parent
082c789d6e
commit
06f337b23e
1 changed files with 14 additions and 12 deletions
|
@ -90,6 +90,7 @@ function trigger.get_active_effects()
|
|||
for _, player in ipairs(minetest.get_connected_players()) do
|
||||
local pname = player:get_player_name()
|
||||
local env = environments[pname]
|
||||
if env ~= nil then
|
||||
if is_weather_active(player, wname, env) then
|
||||
if type(climate_mod.current_weather[pname]) == "nil" then
|
||||
climate_mod.current_weather[pname] = {}
|
||||
|
@ -108,6 +109,7 @@ function trigger.get_active_effects()
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return effects
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue