electro-pneumatic brake operation ai logic tweak, pantograph compressor valve state commands, automatic material update switch, train lights state readout for python scripts, minor bug fixes

This commit is contained in:
tmj-fstate
2020-04-21 16:09:30 +02:00
parent f7d2b8bb7f
commit 17b545e88a
13 changed files with 145 additions and 61 deletions

View File

@@ -4034,17 +4034,19 @@ void opengl33_renderer::Update(double const Deltatime)
}
}
// update resources if there was environmental change
simulation_state simulationstate {
Global.Weather,
Global.Season
};
std::swap( m_simulationstate, simulationstate );
if( ( m_simulationstate.season != simulationstate.season ) && ( false == simulationstate.season.empty() ) ) {
m_materials.on_season_change();
}
if( ( m_simulationstate.weather != simulationstate.weather ) && ( false == simulationstate.weather.empty() ) ) {
m_materials.on_weather_change();
if( Global.UpdateMaterials ) {
// update resources if there was environmental change
simulation_state simulationstate {
Global.Weather,
Global.Season
};
std::swap( m_simulationstate, simulationstate );
if( ( m_simulationstate.season != simulationstate.season ) && ( false == simulationstate.season.empty() ) ) {
m_materials.on_season_change();
}
if( ( m_simulationstate.weather != simulationstate.weather ) && ( false == simulationstate.weather.empty() ) ) {
m_materials.on_weather_change();
}
}
if ((true == Global.ResourceSweep) && (true == simulation::is_ready))