Skip to content

Commit

Permalink
Add an option to disable time regulation
Browse files Browse the repository at this point in the history
  • Loading branch information
Lymkwi committed Feb 5, 2016
1 parent db71252 commit c017cbc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ time_reg.version = "00.01.00"
time_reg.author = "Mg/LeMagnesium"

-- Definitions
time_reg.enabled = not (minetest.setting_getbool("disable_time_regulation") or false)

time_reg.time_speed = 72

time_reg.loop_interval = 0
Expand Down Expand Up @@ -157,7 +159,10 @@ function time_reg.loop(loop)
end

time_reg.update_constants()
time_reg.start_loop()

if time_reg.enabled then
time_reg.start_loop()
end

-- chatcommand
minetest.register_chatcommand("time_reg", {
Expand Down Expand Up @@ -206,3 +211,6 @@ log("\tNight: " .. time_reg.ratio.night .. "%")
log("Applied time speeds:")
log("\tDay: " .. time_reg.day_time_speed)
log("\tNight: " .. time_reg.night_time_speed)
if not time_reg.enabled then
log("Time Regulation is disabled by default. Use /time_reg start to start it")
end

0 comments on commit c017cbc

Please sign in to comment.