forked from mtcontrib/random_messages
avoid crash on missing messages file
This commit is contained in:
parent
17d2fd9f75
commit
7db0c9c50b
2
init.lua
2
init.lua
@ -124,6 +124,7 @@ random_messages.set_interval()
|
|||||||
random_messages.read_messages()
|
random_messages.read_messages()
|
||||||
|
|
||||||
local TIMER = 0
|
local TIMER = 0
|
||||||
|
if random_messages.messages[1] then
|
||||||
minetest.register_globalstep(function(dtime)
|
minetest.register_globalstep(function(dtime)
|
||||||
TIMER = TIMER + dtime;
|
TIMER = TIMER + dtime;
|
||||||
if TIMER > MESSAGE_INTERVAL then
|
if TIMER > MESSAGE_INTERVAL then
|
||||||
@ -131,6 +132,7 @@ minetest.register_globalstep(function(dtime)
|
|||||||
TIMER = 0
|
TIMER = 0
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
local register_chatcommand_table = {
|
local register_chatcommand_table = {
|
||||||
params = "viewmessages | removemessage <number> | addmessage <number>",
|
params = "viewmessages | removemessage <number> | addmessage <number>",
|
||||||
|
Loading…
Reference in New Issue
Block a user