From caf2bda7bc02f0bbe6dbbeb415e7881158d143b9 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Thu, 26 Apr 2018 23:35:19 +0200 Subject: Fix path_dir to actually be an angle, path item deletion and orientation of wagons The occupation system as it is now will change. For each position, I will save the index in the train's path, and implement a callback system. I need this because the occupation window system will not be enough to cover all use cases (e.g. to make a train stop with it's center or back at a certain position, I need 3 different brake distances, which doesn't fit into the scheme) --- advtrains/init.lua | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'advtrains/init.lua') diff --git a/advtrains/init.lua b/advtrains/init.lua index 69b482d..93b25e5 100644 --- a/advtrains/init.lua +++ b/advtrains/init.lua @@ -38,16 +38,20 @@ end function advtrains.pcall(fun) if no_action then return end - --local succ, return1, return2, return3, return4=xpcall(fun, function(err) - -- atwarn("Lua Error occured: ", err) - -- atwarn(debug.traceback()) - -- end) - --if not succ then - -- reload_saves() - --else - -- return return1, return2, return3, return4 - --end - return fun() + local succ, return1, return2, return3, return4=xpcall(fun, function(err) + atwarn("Lua Error occured: ", err) + atwarn(debug.traceback()) + if advtrains.atprint_context_tid_full then + advtrains.path_print(advtrains.trains[advtrains.atprint_context_tid_full], atdebug) + end + end) + if not succ then + --reload_saves() + no_action=true --this does also not belong here! + minetest.request_shutdown() + else + return return1, return2, return3, return4 + end end -- cgit v1.2.3