[random_messages & pipeworks] Change globalsteps, remove variables

- For #179
This commit is contained in:
LeMagnesium 2016-08-03 18:31:00 +02:00
parent e538a7a152
commit 7bf6c9e16e
No known key found for this signature in database
GPG Key ID: A54DDB5272C51E8B
2 changed files with 5 additions and 9 deletions

View File

@ -53,7 +53,6 @@ end
local active_blocks = {} -- These only contain active blocks near players (i.e., not forceloaded ones)
local handle_active_blocks_step = 2
local handle_active_blocks_timer = 0
local function active_blocks_step()
local active_block_range = tonumber(minetest.setting_get("active_block_range")) or 2
local new_active_blocks = {}

View File

@ -103,14 +103,11 @@ end
random_messages.set_interval()
random_messages.read_messages()
local TIMER = 0
minetest.register_globalstep(function(dtime)
TIMER = TIMER + dtime;
if TIMER > MESSAGE_INTERVAL then
random_messages.show_message()
TIMER = 0
end
end)
local function step()
random_messages.show_message()
minetest.after(MESSAGE_INTERVAL, step)
end
minetest.after(0, step)
local register_chatcommand_table = {
params = "viewmessages | removemessage <number> | addmessage <number>",