16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 07:39:19 +02:00

build 190223. doorstep cab control devices, door control system logic tweaks and fixes

This commit is contained in:
tmj-fstate
2019-02-24 02:26:53 +01:00
parent b72e237ab1
commit 8da3a9a74f
17 changed files with 176 additions and 83 deletions

View File

@@ -123,12 +123,13 @@ TButton::Turn( bool const State ) {
}
}
void TButton::Update() {
void TButton::Update( bool const Power ) {
if( ( bData != nullptr )
&& ( *bData != m_state ) ) {
auto const state { Power && ( bData ? *bData : m_state ) };
m_state = ( *bData );
if( state != m_state ) {
m_state = state;
play();
}