yet another fork update #9

Merged
chmodsayshello merged 760 commits from VoxeLibre/VoxeLibre:master into master 2023-03-26 20:27:31 +02:00
1 changed files with 26 additions and 2 deletions
Showing only changes of commit ae92c51155 - Show all commits

View File

@ -357,8 +357,7 @@ function mob_class:outside_limits()
end
end
-- main mob function
function mob_class:on_step(dtime)
local function on_step_work (self, dtime)
local pos = self.object:get_pos()
if not pos then return end
@ -446,6 +445,31 @@ function mob_class:on_step(dtime)
end
end
local on_step_error_handler = function ()
--lua_Debug ar;
--local L = lua_getfield(L, LUA_GLOBALSINDEX, "f");
--lua_getinfo(L, ">S", &ar);
local info = debug.getinfo(1, "SnlufL")
minetest.log("In the error handler")
minetest.log("debug.traceback: ".. tostring(debug.traceback()))
minetest.log("debug.short_src: ".. dump(debug.source))
minetest.log("debug.short_src: ".. dump(info))
--debug.traceback
end
-- main mob function
function mob_class:on_step(dtime)
local status, retVal = xpcall(on_step_work, on_step_error_handler, self, dtime)
if status then
--minetest.log("success. retVal: ".. tostring(retVal))
return retVal
else
minetest.log("failed. error: ".. tostring(retVal))
minetest.log("failed. status: ".. tostring(status))
end
--return on_step_work(self, dtime)
end
local timer = 0
minetest.register_globalstep(function(dtime)
timer = timer + dtime