Player
Player copied to clipboard
Shake screen moves viewport in wrong direction
Issue mentioned in forums, tested in continuous build on Windows and Linux, I made a testcase (attached).

RPG_RT moves right, Player left.
proposed fix:
diff --git a/src/shake.h b/src/shake.h
index 2e29c4839..7880ce4fb 100644
--- a/src/shake.h
+++ b/src/shake.h
@@ -35,7 +35,7 @@ static constexpr int kShakeContinuousTimeStart = 65535;
*/
inline int NextPosition(int strength, int speed, int time_left, int position) {
int amplitude = 1 + 2 * strength;
- int newpos = amplitude * sin((time_left * 4 * (speed + 2)) % 256 * M_PI / 128);
+ int newpos = amplitude * sin((time_left * 4 * (speed + 2)) % 256 * M_PI / 128) * -1;
int cutoff = (speed * amplitude / 8) + 1;
return Utils::Clamp<int>(newpos, position - cutoff, position + cutoff);
thanks. will pick this one into #2860 later