diff --git a/settingtypes.txt b/settingtypes.txt index 4764c884..a09555b6 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -7,3 +7,30 @@ # # Disabling this feature will sacrifice safety for convenience. technic_safe_chainsaw (Chainsaw safety feature) bool true + +# Enables the mining drills. +enable_mining_drill (Enable Mining Drill) bool true + +# Enables Wind Mills. +enable_wind_mill (Enable Wind Mill) bool false + +# Enables the Flashlight. +enable_flashlight (Enable Flashlight) bool false + +# Enables Frames. +enable_frames (Enable Frames) bool false + +# Enables Corium Griefing. +enable_corium_griefing (Enable corium_griefing) bool true + +# Enables Radiation Protection. +enable_radiation_protection (Enable Radiation Protection) bool true + +# Enables Entity Radiation Damage. +enable_entity_radiation_damage (Enable Entity Radiation Damage) bool true + +# Enables Long Term Radiation Damage. +enable_longterm_radiation_damage (Enable Long Term Radiation Damage) bool true + +# Enables Nuclear Reactor Digiline Selfdestruct. +enable_nuclear_reactor_digiline_selfdestruct (Enable Nuclear Reactor Digiline Selfdestruct) bool false \ No newline at end of file diff --git a/technic/config.lua b/technic/config.lua index bb748ec4..db0ec143 100644 --- a/technic/config.lua +++ b/technic/config.lua @@ -2,6 +2,13 @@ technic.config = technic.config or Settings(minetest.get_worldpath().."/technic. local conf_table = technic.config:to_table() +local function bool_to_string(bool) + if bool then + return "true" + end + return "false" +end + local defaults = { enable_mining_drill = "true", enable_mining_laser = "true", @@ -13,10 +20,16 @@ local defaults = { enable_entity_radiation_damage = "true", enable_longterm_radiation_damage = "true", enable_nuclear_reactor_digiline_selfdestruct = "false", + technic_safe_chainsaw = "true", } for k, v in pairs(defaults) do if conf_table[k] == nil then - technic.config:set(k, v) + local minetest_val = minetest.settings:get(k) + if minetest_val == nil then + technic.config:set(k, v) + else + technic.config:set(k, bool_to_string(minetest_val)) + end end end