From b4534c6f1268c48107b6aa0ec6e8b7960c11075a Mon Sep 17 00:00:00 2001 From: orwell96 Date: Wed, 17 Oct 2018 18:58:57 +0200 Subject: Improve ATC-LZB-User control interaction, smoothen LZB control operations (prevent flickering view when atc battles against lzb) --- advtrains/trainlogic.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'advtrains/trainlogic.lua') diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua index 6d903c5..15d8871 100644 --- a/advtrains/trainlogic.lua +++ b/advtrains/trainlogic.lua @@ -329,7 +329,6 @@ function advtrains.train_step_b(id, train, dtime) --interpret ATC command and apply auto-lever control when not actively controlled local trainvelocity = train.velocity - if train.ctrl.user then advtrains.atc.train_reset_command(train) else @@ -343,16 +342,16 @@ function advtrains.train_step_b(id, train, dtime) train.atc_brake_target=nil braketar = nil end - if train.tarvelocity and train.velocity==train.tarvelocity then - train.tarvelocity = nil - end + --if train.tarvelocity and train.velocity==train.tarvelocity then + -- train.tarvelocity = nil + --end if train.atc_wait_finish then - if not train.atc_brake_target and not train.tarvelocity then + if not train.atc_brake_target and (not train.tarvelocity or train.velocity==train.tarvelocity) then train.atc_wait_finish=nil end end if train.atc_command then - if train.atc_delay<=0 and not train.atc_wait_finish then + if (not train.atc_delay or train.atc_delay<=0) and not train.atc_wait_finish then advtrains.atc.execute_atc_command(id, train) else train.atc_delay=train.atc_delay-dtime -- cgit v1.2.3