mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
minor ai tweaks, minor bug fixes
This commit is contained in:
@@ -4783,7 +4783,7 @@ TController::UpdateSituation(double dt) {
|
||||
}
|
||||
else {
|
||||
// przy dużej różnicy wysoki stopień (1,00 potrzebnego opoznienia)
|
||||
if( ( std::max( 75.0, fMaxProximityDist ) + fBrakeDist * braking_distance_multiplier( VelNext ) ) >= ( ActualProximityDist - fMaxProximityDist ) ) {
|
||||
if( ( std::max( 100.0, fMaxProximityDist ) + fBrakeDist * braking_distance_multiplier( VelNext ) ) >= ( ActualProximityDist - fMaxProximityDist ) ) {
|
||||
// don't slow down prematurely; as long as we have room to come to a full stop at a safe distance, we're good
|
||||
// ensure some minimal coasting speed, otherwise a vehicle entering this zone at very low speed will be crawling forever
|
||||
auto const brakingpointoffset = VelNext * braking_distance_multiplier( VelNext );
|
||||
|
||||
11
DynObj.cpp
11
DynObj.cpp
@@ -6559,11 +6559,12 @@ TDynamicObject::powertrain_sounds::render( TMoverParameters const &Vehicle, doub
|
||||
std::max( goalvolume, currentvolume - changerate ) :
|
||||
std::min( goalvolume, currentvolume + changerate ) );
|
||||
|
||||
engine_turbo
|
||||
.pitch( 0.4 + engine_turbo_pitch * 0.4 )
|
||||
.gain( volume );
|
||||
|
||||
if( volume > 0.05 ) {
|
||||
engine_turbo
|
||||
.pitch( 0.4 + engine_turbo_pitch * 0.4 )
|
||||
.gain( volume )
|
||||
.play( sound_flags::exclusive | sound_flags::looping );
|
||||
engine_turbo.play( sound_flags::exclusive | sound_flags::looping );
|
||||
}
|
||||
else {
|
||||
engine_turbo.stop();
|
||||
@@ -6597,7 +6598,7 @@ TDynamicObject::powertrain_sounds::render( TMoverParameters const &Vehicle, doub
|
||||
if( ( true == Vehicle.Mains )
|
||||
&& ( false == motors.empty() ) ) {
|
||||
|
||||
if( std::fabs( Vehicle.enrot ) > 0.01 ) {
|
||||
if( std::abs( Vehicle.enrot ) > 0.01 ) {
|
||||
|
||||
auto const &motor { motors.front() };
|
||||
// frequency calculation
|
||||
|
||||
@@ -4345,7 +4345,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
|
||||
tor = DynamicObject->GetTrack(); // McZapkie-180203
|
||||
// McZapkie: predkosc wyswietlana na tachometrze brana jest z obrotow kol
|
||||
float maxtacho = 3;
|
||||
auto const maxtacho { 3.0 };
|
||||
fTachoVelocity = static_cast<float>( std::min( std::abs(11.31 * mvControlled->WheelDiameter * mvControlled->nrot), mvControlled->Vmax * 1.05) );
|
||||
{ // skacze osobna zmienna
|
||||
float ff = simulation::Time.data().wSecond; // skacze co sekunde - pol sekundy
|
||||
@@ -4361,12 +4361,12 @@ bool TTrain::Update( double const Deltatime )
|
||||
}
|
||||
if (fTachoVelocity > 1) // McZapkie-270503: podkrecanie tachometru
|
||||
{
|
||||
if (fTachoCount < maxtacho)
|
||||
fTachoCount += Deltatime * 3; // szybciej zacznij stukac
|
||||
// szybciej zacznij stukac
|
||||
fTachoCount = std::min( maxtacho, fTachoCount + Deltatime * 3 );
|
||||
}
|
||||
else if( fTachoCount > 0 ) {
|
||||
// schodz powoli - niektore haslery to ze 4 sekundy potrafia stukac
|
||||
fTachoCount -= Deltatime * 0.66;
|
||||
fTachoCount = std::max( 0.0, fTachoCount - Deltatime * 0.66 );
|
||||
}
|
||||
|
||||
// Ra 2014-09: napięcia i prądy muszą być ustalone najpierw, bo wysyłane są ewentualnie na PoKeys
|
||||
|
||||
Reference in New Issue
Block a user