aboutsummaryrefslogtreecommitdiff
path: root/advtrains/init.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-04-26 23:35:19 +0200
committerorwell96 <orwell@bleipb.de>2018-06-14 17:39:42 +0200
commitcaf2bda7bc02f0bbe6dbbeb415e7881158d143b9 (patch)
tree6cf81bb311517b3ae1108c6533fa8f28c803ed9e /advtrains/init.lua
parent139a26fccce1e622d58f1673284e2addfb0d1ed2 (diff)
downloadadvtrains-caf2bda7bc02f0bbe6dbbeb415e7881158d143b9.tar.gz
advtrains-caf2bda7bc02f0bbe6dbbeb415e7881158d143b9.tar.bz2
advtrains-caf2bda7bc02f0bbe6dbbeb415e7881158d143b9.zip
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)
Diffstat (limited to 'advtrains/init.lua')
-rw-r--r--advtrains/init.lua24
1 files changed, 14 insertions, 10 deletions
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