diff --git a/Driver.h b/Driver.h index 02040691..70764f8f 100644 --- a/Driver.h +++ b/Driver.h @@ -435,6 +435,7 @@ private: double LastReactionTime = 0.0; double fActionTime = 0.0; // czas używany przy regulacji prędkości i zamykaniu drzwi double m_radiocontroltime{ 0.0 }; // timer used to control speed of radio operations + double m_securitysystemreset { 1.0 }; // timer used to control speed of security system resetting TAction eAction{ TAction::actUnknown }; // aktualny stan std::list< std::tuple > m_hints; // queued ai operations diff --git a/driverhints.cpp b/driverhints.cpp index e9e16ce0..41972773 100644 --- a/driverhints.cpp +++ b/driverhints.cpp @@ -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,