mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-19 02:09:17 +02:00
randomized delay for using of security system button by AI
This commit is contained in:
1
Driver.h
1
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<locale::string, hintpredicate, float> > m_hints; // queued ai operations
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user