diff options
author | Filippos Karapetis | 2013-01-22 00:56:46 +0200 |
---|---|---|
committer | Filippos Karapetis | 2013-01-22 00:56:46 +0200 |
commit | b95695719f69658c7abe3e01d9c9a9c066b73864 (patch) | |
tree | a1e58549338d619f13c673becb5a5c2fb3d2f7a6 /engines | |
parent | edd6f58457352c5ace7989b9ed9074e782bd04cb (diff) | |
download | scummvm-rg350-b95695719f69658c7abe3e01d9c9a9c066b73864.tar.gz scummvm-rg350-b95695719f69658c7abe3e01d9c9a9c066b73864.tar.bz2 scummvm-rg350-b95695719f69658c7abe3e01d9c9a9c066b73864.zip |
SCI: Fix angle rounding in the SCI1 implementation of kGetAngle (bug #3601479)
Fixes bug #3601479 - "SCI KQ6: Castle walls - stuck in same room".
Many thanks to wjp for his help on the kGetAngle implementation
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kmath.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/sci/engine/kmath.cpp b/engines/sci/engine/kmath.cpp index 4b8fadbb84..14a20b8da1 100644 --- a/engines/sci/engine/kmath.cpp +++ b/engines/sci/engine/kmath.cpp @@ -87,7 +87,7 @@ uint16 kGetAngleWorker(int16 x1, int16 y1, int16 x2, int16 y2) { // SCI1 games (QFG2 and newer) use a simple atan implementation. SCI0 games // use a somewhat less accurate calculation (below). if (getSciVersion() >= SCI_VERSION_1_EGA_ONLY) - return (int16)(360 - atan2((double)(x1 - x2), (double)(y1 - y2)) * 57.2958) % 360; + return (int16)(360 - atan2((double)(x1 - x2), (double)(y1 - y2)) * 180 / M_PI + 0.5) % 360; int16 xRel = x2 - x1; int16 yRel = y1 - y2; // y-axis is mirrored. |