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

randomized delay for using of security system button by AI

This commit is contained in:
Królik Uszasty
2021-05-25 20:26:16 +02:00
parent 81fe7e2187
commit 1eafc46ec9
2 changed files with 7 additions and 1 deletions

View File

@@ -1170,7 +1170,12 @@ TController::cue_action( locale::string const Action, float const Actionparamete
case locale::string::driver_hint_securitysystemreset: {
if( AIControllFlag ) {
mvOccupied->SecuritySystemReset();
auto time{ std::max(std::max(mvOccupied->SecuritySystem.SystemSoundSHPTimer, mvOccupied->SecuritySystem.SystemSoundCATimer),
std::max(mvOccupied->SecuritySystem.SystemBrakeSHPTimer, mvOccupied->SecuritySystem.SystemBrakeCATimer)) };
if (time > m_securitysystemreset) {
mvOccupied->SecuritySystemReset();
m_securitysystemreset = 0.5 + Random();
}
}
hint(
Action,