mirror of
https://github.com/minetest-mods/digilines.git
synced 2025-03-25 05:40:22 +01:00
Fix crash because of prev_time == nil
This commit is contained in:
parent
5457e76636
commit
faba1d8149
@ -29,7 +29,7 @@ local function send_message(pos, action, stack, from_slot, to_slot, side)
|
|||||||
|
|
||||||
-- Check if we need to include the current signal into batch
|
-- Check if we need to include the current signal into batch
|
||||||
-- Store "prev_time" in metadata as a string to avoid integer overflow
|
-- Store "prev_time" in metadata as a string to avoid integer overflow
|
||||||
local prev_time = tonumber(meta:get_string("prev_time"))
|
local prev_time = tonumber(meta:get_string("prev_time") or "0")
|
||||||
local cur_time = minetest.get_us_time()
|
local cur_time = minetest.get_us_time()
|
||||||
meta:set_string("prev_time", tostring(cur_time))
|
meta:set_string("prev_time", tostring(cur_time))
|
||||||
if cur_time - prev_time < 1000000 * interval_to_batch then
|
if cur_time - prev_time < 1000000 * interval_to_batch then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user