diff options
author | orwell96 <orwell@bleipb.de> | 2018-10-17 18:58:57 +0200 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2018-10-17 18:58:57 +0200 |
commit | b4534c6f1268c48107b6aa0ec6e8b7960c11075a (patch) | |
tree | f26648305e4457dad480239b3131a1a366c6d925 /advtrains/trainlogic.lua | |
parent | cd38b17eabb8cdc37bd7e11a89fd0fd049910ffc (diff) | |
download | advtrains-b4534c6f1268c48107b6aa0ec6e8b7960c11075a.tar.gz advtrains-b4534c6f1268c48107b6aa0ec6e8b7960c11075a.tar.bz2 advtrains-b4534c6f1268c48107b6aa0ec6e8b7960c11075a.zip |
Improve ATC-LZB-User control interaction, smoothen LZB control operations
(prevent flickering view when atc battles against lzb)
Diffstat (limited to 'advtrains/trainlogic.lua')
-rw-r--r-- | advtrains/trainlogic.lua | 11 |
1 files changed, 5 insertions, 6 deletions
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 |