Skip to content
This repository was archived by the owner on Aug 20, 2020. It is now read-only.

Commit 7bf6c9e

Browse files
committed
[random_messages & pipeworks] Change globalsteps, remove variables
- For #179
1 parent e538a7a commit 7bf6c9e

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

mods/pipeworks/luaentity.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ end
5353

5454
local active_blocks = {} -- These only contain active blocks near players (i.e., not forceloaded ones)
5555
local handle_active_blocks_step = 2
56-
local handle_active_blocks_timer = 0
5756
local function active_blocks_step()
5857
local active_block_range = tonumber(minetest.setting_get("active_block_range")) or 2
5958
local new_active_blocks = {}

mods/random_messages/init.lua

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,11 @@ end
103103
random_messages.set_interval()
104104
random_messages.read_messages()
105105

106-
local TIMER = 0
107-
minetest.register_globalstep(function(dtime)
108-
TIMER = TIMER + dtime;
109-
if TIMER > MESSAGE_INTERVAL then
110-
random_messages.show_message()
111-
TIMER = 0
112-
end
113-
end)
106+
local function step()
107+
random_messages.show_message()
108+
minetest.after(MESSAGE_INTERVAL, step)
109+
end
110+
minetest.after(0, step)
114111

115112
local register_chatcommand_table = {
116113
params = "viewmessages | removemessage <number> | addmessage <number>",

0 commit comments

Comments
 (0)