diff options
author | orwell96 <orwell@bleipb.de> | 2020-06-10 19:04:50 +0200 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2021-02-10 16:36:24 +0100 |
commit | b5f87370950f17a9ea40802415526762dba7994b (patch) | |
tree | 2e878f04c0e5845fe7320041658606e3ed72fc2d /advtrains | |
parent | a3247dea289c3cb487a6d2d730f3fe67bf49f27b (diff) | |
download | advtrains-b5f87370950f17a9ea40802415526762dba7994b.tar.gz advtrains-b5f87370950f17a9ea40802415526762dba7994b.tar.bz2 advtrains-b5f87370950f17a9ea40802415526762dba7994b.zip |
More debug info to hopefully gain more info on the bug
Diffstat (limited to 'advtrains')
-rw-r--r-- | advtrains/atc.lua | 5 | ||||
-rw-r--r-- | advtrains/trainlogic.lua | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/advtrains/atc.lua b/advtrains/atc.lua index a1be084..286a9b0 100644 --- a/advtrains/atc.lua +++ b/advtrains/atc.lua @@ -73,7 +73,10 @@ function atc.send_command(pos, par_tid, train_id_temp_debug) else atwarn("ATC rail at", pos, ": Sending command failed: There's no train at this position. This seems to be a bug.") -- huch - advtrains.path_print(advtrains.trains[train_id_temp_debug], atdebug) + local train = advtrains.trains[train_id_temp_debug] + atlog("Train speed is",train.velocity,", have moved",train.dist_moved_this_step,", lever",train.lever) + advtrains.path_print(train, atlog) + end else atwarn("ATC rail at", pos, ": Sending command failed: Entry for controller not found.") diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua index be0d60e..bb1e1b9 100644 --- a/advtrains/trainlogic.lua +++ b/advtrains/trainlogic.lua @@ -477,6 +477,7 @@ function advtrains.train_step_b(id, train, dtime) -- only needs to run if we're not yet braking anyway new_index_v_base = v0 + (advtrains.get_acceleration(train, tv_lever) * dtime) local dst_curr_v = new_index_v_base * dtime + train.dist_moved_this_step = dst_curr_v new_index_curr_tv = advtrains.path_get_index_by_offset(train, train.index, dst_curr_v) local i = atfloor(train.index) local lzb_target @@ -549,6 +550,7 @@ function advtrains.train_step_b(id, train, dtime) if not new_index_v_base or new_index_v_base ~= v1 then local tv_vdiff = advtrains.get_acceleration(train, tv_lever) * dtime local dst_curr_v = v1 * dtime + train.dist_moved_this_step = dst_curr_v new_index_curr_tv = advtrains.path_get_index_by_offset(train, train.index, dst_curr_v) end @@ -755,6 +757,7 @@ function advtrains.tnc_call_approach_callback(pos, train_id, train, index, lzbda run_callbacks_approach_node(pos, train_id, train, index, has_entered, lzbdata) end +-- === te callback definition for tnc node callbacks === advtrains.te_register_on_new_path(function(id, train) train.tnc = { |