use us_time instead of gametime due to lack of precision, sleep → usleep

M  faden.lua
M  standardbefehlssatz.lua
This commit is contained in:
Hybrid Dog 2016-12-28 22:05:48 +01:00
parent b03c1fe61b
commit 641aa73686
2 changed files with 4 additions and 4 deletions

View File

@ -82,7 +82,7 @@ return function(faden_manip, parsed)
self:suscitate()
end,
try_rebirth = function(self)
if minetest.get_gametime() >= self.rebirth then
if minetest.get_us_time() >= self.rebirth then
self:continue()
end
end,

View File

@ -106,7 +106,7 @@ s = {
return false, "jump target out of range"
end
faden.ip = p-1
if not s.sleep({0}, faden) then
if not s.usleep({0}, faden) then
error(SE)
end
return true
@ -179,7 +179,7 @@ s = {
return true, params[1] < params[2]
end,
sleep = function(params, faden)
usleep = function(params, faden)
if #params ~= 1 then
return false, WNOA
end
@ -187,7 +187,7 @@ s = {
if type(p) ~= "number" then
return false, UAT
end
faden.rebirth = minetest.get_gametime() + p
faden.rebirth = minetest.get_us_time() + p
faden:stop()
return true
end,