Undocumented minetest.get_gametime()
returning nil at init time
#13882
Labels
minetest.get_gametime()
returning nil at init time
#13882
Minetest version
Active renderer
No response
Irrlicht device
No response
Operating system and version
Windows 10
CPU model
AMD FX 6100
GPU model
No response
OpenGL version
No response
Summary
Very simply, I was experimenting to see if minetest.get_gametime() could be useful, and my code exploded. Turns out, it's returning nil. (or at the least, type(minetest.get_gametime())==nil.)
Discovered the issue when trying to subtract one timestamp from another. I wasn't aware of #10221. Still, subtracting one integer from another shouldn't cause problems.
Occurs in minetest_game, both stable-5 and main (if this makes any difference).
Steps to reproduce
assert(minetest.get_gametime(), 'get_gametime should be a number of seconds')
2023-10-11 02:48:38: ERROR[Main]: ModError: Failed to load and run script from C:\local\opt\minetest-5.7.0-win64\bin..\mods\sane_liquid\init.lua:
2023-10-11 02:48:38: ERROR[Main]: ...pt\minetest-5.7.0-win64\bin..\mods\sane_liquid\init.lua:159: get_gametime should be a number of seconds
2023-10-11 02:48:38: ERROR[Main]: stack traceback:
2023-10-11 02:48:38: ERROR[Main]: [C]: in function 'assert'
2023-10-11 02:48:38: ERROR[Main]: ...pt\minetest-5.7.0-win64\bin..\mods\sane_liquid\init.lua:159: in main chunk
The text was updated successfully, but these errors were encountered: