mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-23 06:19:18 +02:00
Overflow protection for wiper sound
This commit is contained in:
@@ -4195,14 +4195,14 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
}
|
}
|
||||||
dWiperPos[i] = std::max(0.0, dWiperPos[i] - (1.f / currentWiperParams.WiperSpeed) * dt1);
|
dWiperPos[i] = std::max(0.0, dWiperPos[i] - (1.f / currentWiperParams.WiperSpeed) * dt1);
|
||||||
}
|
}
|
||||||
if (dWiperPos[i] == 1.0) // we reached end
|
if (dWiperPos[i] >= 1.0) // we reached end
|
||||||
{
|
{
|
||||||
sWiperFromPark.stop();
|
sWiperFromPark.stop();
|
||||||
sWiperFromParkPlayed = false;
|
sWiperFromParkPlayed = false;
|
||||||
wiperParkTimer[i] = 0.0;
|
wiperParkTimer[i] = 0.0;
|
||||||
wiperDirection[i] = true; // switch direction
|
wiperDirection[i] = true; // switch direction
|
||||||
}
|
}
|
||||||
if (dWiperPos[i] == 0.0)
|
if (dWiperPos[i] <= 0.0)
|
||||||
{
|
{
|
||||||
// when in park position
|
// when in park position
|
||||||
sWiperToPark.stop();
|
sWiperToPark.stop();
|
||||||
|
|||||||
Reference in New Issue
Block a user