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

build 190809. load weights data file

This commit is contained in:
tmj-fstate
2019-08-09 23:49:41 +02:00
parent c951b1b955
commit 7ebf6bd7cf
7 changed files with 66 additions and 25 deletions

View File

@@ -1616,6 +1616,7 @@ TDynamicObject::Init(std::string Name, // nazwa pojazdu, np. "EU07-424"
}
// load the cargo now that we know whether the vehicle will allow it
MoverParameters->AssignLoad( LoadType, Load );
MoverParameters->ComputeMass();
bool driveractive = (fVel != 0.0); // jeśli prędkość niezerowa, to aktywujemy ruch
if (!MoverParameters->CheckLocomotiveParameters(
@@ -2431,6 +2432,7 @@ void TDynamicObject::update_exchange( double const Deltatime ) {
m_exchange.unload_count -= exchangesize;
MoverParameters->LoadStatus = 1;
MoverParameters->LoadAmount = std::max( 0.f, MoverParameters->LoadAmount - exchangesize );
MoverParameters->ComputeMass();
update_load_visibility();
}
if( m_exchange.unload_count < 0.01 ) {
@@ -2445,6 +2447,7 @@ void TDynamicObject::update_exchange( double const Deltatime ) {
m_exchange.load_count -= exchangesize;
MoverParameters->LoadStatus = 2;
MoverParameters->LoadAmount = std::min( MoverParameters->MaxLoad, MoverParameters->LoadAmount + exchangesize ); // std::max not strictly needed but, eh
MoverParameters->ComputeMass();
update_load_visibility();
}
}