diff --git a/engine/include/OpenScenarioEngine/OpenScenarioEngine.h b/engine/include/OpenScenarioEngine/OpenScenarioEngine.h index c25b09fab7daa945d1e3528c14ee0135703c27aa..c31735db090d17b0678c7519e255a94b96796ccc 100644 --- a/engine/include/OpenScenarioEngine/OpenScenarioEngine.h +++ b/engine/include/OpenScenarioEngine/OpenScenarioEngine.h @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2021-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2021-2025 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) * Copyright (c) 2022-2023 Ansys, Inc. * * This program and the accompanying materials are made available under the @@ -184,6 +184,7 @@ private: ScenarioDefinitionPtr scenario_definition_ptr_{nullptr}; bool finished_{false}; + bool first_run_{true}; std::optional<unsigned int> random_seed_value_override_{std::nullopt}; }; diff --git a/engine/src/OpenScenarioEngine.cpp b/engine/src/OpenScenarioEngine.cpp index ebc45a854e2fc2d31e876c0744df1c097987f96f..f9dd77515440403fcedec1f9a210a1c79a056ac2 100644 --- a/engine/src/OpenScenarioEngine.cpp +++ b/engine/src/OpenScenarioEngine.cpp @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2021-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2021-2025 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) * Copyright (c) 2022-2023 Ansys, Inc. * * This program and the accompanying materials are made @@ -133,10 +133,9 @@ void OpenScenarioEngine::ResetProbabilityService() } else { - static bool first_run{true}; - if (first_run) + if (first_run_) { - first_run = false; + first_run_ = false; } else {