From 46c4447da089146c662f217bf3269d78d4c462c2 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Mon, 18 Dec 2017 21:44:36 +0100 Subject: Rewrite rail connection system... ...to support an arbitrary number of connections for rails, which leads to these new features: - switches now get recognized by the trackworker correctly - ability to add real rail crosses During this, I also rewrote the rail registering system and the conway function (important part of path prediction) Note, developers: the track preset format changed, you might need to rewrite them according to the presets in tracks.lua if you wrote your own (possibly breaks advcarts) --- advtrains/init.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'advtrains/init.lua') diff --git a/advtrains/init.lua b/advtrains/init.lua index 5975b81..e3a19e4 100644 --- a/advtrains/init.lua +++ b/advtrains/init.lua @@ -7,6 +7,9 @@ end --advtrains +--Constant for maximum connection value/division of the circle +AT_CMAX = 16 + advtrains = {trains={}, wagon_save={}, player_to_train_mapping={}} --pcall @@ -99,6 +102,13 @@ atwarn=function(t, ...) end sid=function(id) if id then return string.sub(id, -6) end end +--TEMP +atdebug=function(t, ...) + local text=advtrains.print_concat_table({t, ...}) + minetest.log("action", "[advtrains]"..text) + minetest.chat_send_all("[advtrains]"..text) + end + if minetest.settings:get_bool("advtrains_enable_debugging") then atprint=function(t, ...) local context=advtrains.atprint_context_tid or "" @@ -135,7 +145,7 @@ advtrains.meseconrules = {x=0, y=-2, z=0}} - +dofile(advtrains.modpath.."/path.lua") dofile(advtrains.modpath.."/trainlogic.lua") dofile(advtrains.modpath.."/trainhud.lua") dofile(advtrains.modpath.."/trackplacer.lua") -- cgit v1.2.3