17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 06:19:19 +02:00

fix(sonar): addressing reliability/security issues (#202)

This commit is contained in:
jerrrrycho
2026-10-04 20:00:13 +02:00
committed by GitHub
parent 51521a135a
commit 79bd0c8e91
36 changed files with 254 additions and 246 deletions

View File

@@ -137,6 +137,11 @@ state_manager::update_scripting_interface() {
auto *time{ Memory.find( "__simulation.time" ) };
auto *date{ Memory.find( "__simulation.date" ) };
if( weather == nullptr || time == nullptr || date == nullptr ) {
// scripting interface cells weren't created, nothing to synchronize
return;
}
if( simulation::is_ready ) {
// potentially adjust weather
if( weather->Value1() != m_scriptinginterface.weather->Value1() ) {
@@ -396,7 +401,6 @@ void state_manager::process_commands() {
pantograph.fLenL1 * std::sin( pantograph.fAngleL )
+ pantograph.fLenU1 * std::sin( pantograph.fAngleU )
+ pantograph.fHeight;
vehicle->MoverParameters->EnginePowerSource.CollectorParameters.CollectorsNo;
}
vehicle = vehicle->Prev();