16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 17:59:18 +02:00

Merge branch 'tmj-dev' into milek-dev

This commit is contained in:
milek7
2018-09-20 22:00:02 +02:00
39 changed files with 2997 additions and 2171 deletions

View File

@@ -49,20 +49,19 @@ basic_station::update_load( TDynamicObject *First, Mtable::TTrainParameters &Sch
auto &parameters { *vehicle->MoverParameters };
if( ( true == parameters.LoadType.empty() )
&& ( parameters.LoadAccepted.find( "passengers" ) != std::string::npos ) ) {
// set the type for empty cars
parameters.LoadType = "passengers";
if( parameters.LoadType.name.empty() ) {
// (try to) set the cargo type for empty cars
parameters.AssignLoad( "passengers" );
}
if( parameters.LoadType == "passengers" ) {
if( parameters.LoadType.name == "passengers" ) {
// NOTE: for the time being we're doing simple, random load change calculation
// TODO: exchange driven by station parameters and time of the day
auto unloadcount = static_cast<int>(
laststop ? parameters.Load :
laststop ? parameters.LoadAmount :
firststop ? 0 :
std::min<float>(
parameters.Load,
parameters.LoadAmount,
Random( parameters.MaxLoad * 0.10 * stationsizemodifier ) ) );
auto loadcount = static_cast<int>(
laststop ?