mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-04 23:31:05 +01:00
[mcl_weather] Fix crash on saving uninitialized data, https://git.minetest.land/MineClone2/MineClone2/issues/1361
This commit is contained in:
parent
7fe3217cd0
commit
66a64439c6
1 changed files with 1 additions and 0 deletions
|
@ -38,6 +38,7 @@ mcl_weather.reg_weathers["none"] = {
|
|||
local storage = minetest.get_mod_storage()
|
||||
-- Save weather into mod storage, so it can be loaded after restarting the server
|
||||
local save_weather = function()
|
||||
if not mcl_weather.end_time then return end
|
||||
storage:set_string("mcl_weather_state", mcl_weather.state)
|
||||
storage:set_int("mcl_weather_end_time", mcl_weather.end_time)
|
||||
minetest.log("verbose", "[mcl_weather] Weather data saved: state="..mcl_weather.state.." end_time="..mcl_weather.end_time)
|
||||
|
|
Loading…
Reference in a new issue