1
0
mirror of synced 2024-11-13 18:10:51 +01:00

stop sine if period is less then 1 (apparently causes crash)

This commit is contained in:
Boomslangnz 2024-07-21 14:49:16 +12:00
parent 13b43fb573
commit b6e5cef7bf

View File

@ -1572,6 +1572,10 @@ void TriggerSineEffect(UINT16 period, UINT16 fadePeriod, double strength)
long long elapsedTime = (std::chrono::duration_cast<std::chrono::milliseconds>(now - timeOfLastSineEffect)).count();
int direction = 1;
if (period < 1)
return;
if (strength < -0.001) {
strength *= -1;
direction = -1;