diff options
author | orwell96 <orwell@bleipb.de> | 2017-12-18 21:44:36 +0100 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2017-12-18 23:09:23 +0100 |
commit | 46c4447da089146c662f217bf3269d78d4c462c2 (patch) | |
tree | e846a588b6ddfb03c456b0c3c4d0653cd3402b85 /advtrains/init.lua | |
parent | faa60e2bd4d35054f23fda68c06a601f2a197257 (diff) | |
download | advtrains-46c4447da089146c662f217bf3269d78d4c462c2.tar.gz advtrains-46c4447da089146c662f217bf3269d78d4c462c2.tar.bz2 advtrains-46c4447da089146c662f217bf3269d78d4c462c2.zip |
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)
Diffstat (limited to 'advtrains/init.lua')
-rw-r--r-- | advtrains/init.lua | 12 |
1 files changed, 11 insertions, 1 deletions
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") |