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

build 190411. configurable diesel-electric engine momentum, minor bug fixes

This commit is contained in:
tmj-fstate
2019-04-14 16:33:48 +02:00
parent 934163a623
commit 4794ec07ec
6 changed files with 17 additions and 11 deletions

View File

@@ -6625,14 +6625,16 @@ void TController::DirectionForward(bool forward)
// do przodu w obecnej kabinie
while( ( mvOccupied->ActiveDir <= 0 )
&& ( mvOccupied->DirectionForward() ) ) {
; // all work is done in the header
// force scan table update
iTableDirection = 0;
}
}
else {
// do tyłu w obecnej kabinie
while( ( mvOccupied->ActiveDir >= 0 )
&& ( mvOccupied->DirectionBackward() ) ) {
; // all work is done in the header
// force scan table update
iTableDirection = 0;
}
}
if( mvOccupied->TrainType == dt_SN61 ) {

View File

@@ -2319,7 +2319,9 @@ void TDynamicObject::AttachPrev(TDynamicObject *Object, int iType)
{ // Ra: doczepia Object na końcu składu (nazwa funkcji może być myląca)
// Ra: używane tylko przy wczytywaniu scenerii
MoverParameters->Attach( iDirection, Object->iDirection ^ 1, Object->MoverParameters, iType, true, false );
// update neighbour data for both affected vehicles
update_neighbours();
Object->update_neighbours();
}
bool TDynamicObject::UpdateForce(double dt)
@@ -4343,10 +4345,6 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
m_materialdata.textures_alpha |= 0x08080008;
}
}
if( false == MoverParameters->LoadAttributes.empty() ) {
// Ra: tu wczytywanie modelu ładunku jest w porządku
mdLoad = LoadMMediaFile_mdload( MoverParameters->LoadType.name );
}
Global.asCurrentTexturePath = szTexturePath; // z powrotem defaultowa sciezka do tekstur
do {
token = "";
@@ -4927,6 +4925,11 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
} while( ( token != "" )
&& ( token != "endmodels" ) );
if( false == MoverParameters->LoadAttributes.empty() ) {
// Ra: tu wczytywanie modelu ładunku jest w porządku
mdLoad = LoadMMediaFile_mdload( MoverParameters->LoadType.name );
}
} // models
else if( token == "sounds:" ) {

View File

@@ -4406,7 +4406,7 @@ double TMoverParameters::TractionForce( double dt ) {
if( enrot != tmp ) {
enrot = clamp(
enrot + ( dt / 1.25 ) * ( // TODO: equivalent of dizel_aim instead of fixed inertia
enrot + ( dt / dizel_AIM ) * (
enrot < tmp ?
1.0 :
-2.0 ), // NOTE: revolutions drop faster than they rise, maybe? TBD: maybe not
@@ -6080,7 +6080,7 @@ void TMoverParameters::CheckEIMIC(double dt)
eimic += clamp(UniCtrlList[MainCtrlPos].SetCtrlVal - eimic, 0.0, dt * UniCtrlList[MainCtrlPos].SpeedUp); //dodawaj do X
eimic = clamp(eimic, UniCtrlList[MainCtrlPos].MinCtrlVal, UniCtrlList[MainCtrlPos].MaxCtrlVal);
}
eimic = clamp(eimic, -1.0, Mains ? 1.0 : 0.0);
eimic = clamp(eimic, -1.0, ( ( true == Mains ) || ( Power == 0.0 ) ) ? 1.0 : 0.0);
}
void TMoverParameters::CheckSpeedCtrl()
@@ -8945,6 +8945,7 @@ void TMoverParameters::LoadFIZ_Engine( std::string const &Input ) {
ImaxLo = 1;
}
extract_value( EngineHeatingRPM, "HeatingRPM", Input, "" );
extract_value( dizel_AIM, "AIM", Input, "1.25" );
break;
}
case TEngineType::ElectricInductionMotor: {

View File

@@ -5221,7 +5221,7 @@ bool TTrain::Update( double const Deltatime )
}
bool kier = (DynamicObject->DirectionGet() * mvOccupied->ActiveCab > 0);
TDynamicObject *p = DynamicObject->GetFirstDynamic(mvOccupied->ActiveCab < 0 ? 1 : 0, 4);
TDynamicObject *p = DynamicObject->GetFirstDynamic(mvOccupied->ActiveCab < 0 ? end::rear : end::front, 4);
int in = 0;
fEIMParams[0][6] = 0;
iCarNo = 0;

View File

@@ -178,7 +178,7 @@ state_serializer::deserialize_atmo( cParser &Input, scene::scratch_data &Scratch
Global.fFogEnd =
clamp(
Random( fograngestart, fograngeend ),
Random( std::min( fograngestart, fograngeend ), std::max( fograngestart, fograngeend ) ),
100.0, 2000.0 );
}

View File

@@ -1,5 +1,5 @@
#pragma once
#define VERSION_MAJOR 19
#define VERSION_MINOR 406
#define VERSION_MINOR 411
#define VERSION_REVISION 0