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

(separate shp reset) add handling of SeparateAcknowledge flag

This commit is contained in:
Marcin Nowak
2022-05-23 02:52:35 +02:00
committed by Milek7
parent 556af193ac
commit 9bb85ba554
10 changed files with 53 additions and 6 deletions

View File

@@ -693,6 +693,7 @@ public:
bool is_braking() const;
bool is_engine_blocked() const;
bool radiostop_available() const;
bool has_separate_acknowledge() const;
void load(std::string const &line, double Vmax);
double MagnetLocation = 0.0;

View File

@@ -132,10 +132,11 @@ void TSecuritySystem::update(double dt, double vel, bool pwr, int cab) {
press_timer = 0.0;
return;
}
bool just_powered_on = !power && pwr;
bool just_activated = CabDependent && (cabactive != cab);
/* enabling battery */
if (!DebugModeFlag && cabsignal_enabled && (just_powered_on || just_activated)) {
cabsignal_active = true;
alert_timer = SoundSignalDelay;
@@ -162,6 +163,10 @@ void TSecuritySystem::set_cabsignal() {
cabsignal_active = true;
}
bool TSecuritySystem::has_separate_acknowledge() const {
return separate_acknowledge;
}
bool TSecuritySystem::is_blinking() const {
if (!power)
return false;