Fix: New world config to contain copied values from a default config.

master
aa6 2019-08-24 19:07:21 +03:00
parent e8b5c0def5
commit 8ab5d0f6bc
3 changed files with 10 additions and 5 deletions

View File

@ -1 +1 @@
0.10.9
0.10.10

View File

@ -39,10 +39,15 @@ if file_exists(minetest_wadsprint.worldconfig) then
dofile(minetest_wadsprint.worldconfig)
else
print("Creating minetest_wadsprint world-specific config: "..minetest_wadsprint.worldconfig)
file_put_contents(
minetest_wadsprint.worldconfig,
"-- World-specific config. Copy here values from `mods/minetest_wadsprint/config.lua`:\n"
)
local new_world_config_contents =
"-- World-specific config. Values are taken from `mods/minetest_wadsprint/config.lua`:\n"..
"-- Please uncomment lines of your need and set the desired value.\n"
for line in string.gmatch(file_get_contents(minetest.get_modpath(minetest.get_current_modname()).."/config.lua"), "[^\r\n]+") do
if string.sub(line,0,19) == "minetest_wadsprint." then
new_world_config_contents = new_world_config_contents.."-- "..line.."\n"
end
end
file_put_contents(minetest_wadsprint.worldconfig,new_world_config_contents)
end
-- Processing some config values to avoid further unnecessary calculations.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB