aboutsummaryrefslogtreecommitdiff
path: root/advtrains
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-10-07 22:21:49 +0200
committerorwell96 <orwell@bleipb.de>2018-10-07 22:21:49 +0200
commit8df7bcf6b6ea6333b3df925af528e23574974d69 (patch)
tree416d247272b6d6878b6e5024eca6965c21d81c22 /advtrains
parent8e70c070c1be102a679ff3fd6f71669c883ec510 (diff)
downloadadvtrains-8df7bcf6b6ea6333b3df925af528e23574974d69.tar.gz
advtrains-8df7bcf6b6ea6333b3df925af528e23574974d69.tar.bz2
advtrains-8df7bcf6b6ea6333b3df925af528e23574974d69.zip
Improve route programming:
- Formspec for TCBs instead of unhandy chatcommands - Ability to advance route over the next secction without punching end - Better visualization - Ability to route into dead-end sections
Diffstat (limited to 'advtrains')
-rw-r--r--advtrains/init.lua17
1 files changed, 14 insertions, 3 deletions
diff --git a/advtrains/init.lua b/advtrains/init.lua
index a02b377..46a73d4 100644
--- a/advtrains/init.lua
+++ b/advtrains/init.lua
@@ -11,6 +11,8 @@ end
--advtrains
+DUMP_DEBUG_SAVE = false
+
--Constant for maximum connection value/division of the circle
AT_CMAX = 16
@@ -108,9 +110,9 @@ sid=function(id) if id then return string.sub(id, -6) end end
--ONLY use this function for temporary debugging. for consistent debug prints use atprint
atdebug=function(t, ...)
--- local text=advtrains.print_concat_table({t, ...})
--- minetest.log("action", "[advtrains]"..text)
--- minetest.chat_send_all("[advtrains]"..text)
+ 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
@@ -320,6 +322,15 @@ advtrains.avt_save = function(remove_players_from_wagons)
end
file:write(datastr)
file:close()
+
+ if DUMP_DEBUG_SAVE then
+ local file, err = io.open(advtrains.fpath.."_DUMP", "w")
+ if err then
+ return
+ end
+ file:write(dump(save_tbl))
+ file:close()
+ end
end
--## MAIN LOOP ##--