aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe
diff options
context:
space:
mode:
authorEugene Sandulenko2016-09-09 17:08:08 +0200
committerEugene Sandulenko2016-09-09 17:08:08 +0200
commit4fc6f0233111fa693c452917df08c2266f5affdd (patch)
treefefb04cb72c3d03b8559fbf446bd9cfd30806ac4 /engines/fullpipe
parent96e418743a6b92e184ff50a3ac06332510f7c257 (diff)
downloadscummvm-rg350-4fc6f0233111fa693c452917df08c2266f5affdd.tar.gz
scummvm-rg350-4fc6f0233111fa693c452917df08c2266f5affdd.tar.bz2
scummvm-rg350-4fc6f0233111fa693c452917df08c2266f5affdd.zip
FULLPIPE: Make calculation in scene27 more readable
Diffstat (limited to 'engines/fullpipe')
-rw-r--r--engines/fullpipe/scenes/scene27.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/fullpipe/scenes/scene27.cpp b/engines/fullpipe/scenes/scene27.cpp
index 21c82096d5..efbf4f7b90 100644
--- a/engines/fullpipe/scenes/scene27.cpp
+++ b/engines/fullpipe/scenes/scene27.cpp
@@ -338,7 +338,7 @@ void sceneHandler27_knockBats(int bat1n, int bat2n) {
debugC(2, kDebugSceneLogic, "scene27: knockBats(%d, %d)", bat1n, bat2n);
if (0.0 != bat1->power) {
- double rndF = (double)g_fp->_rnd->getRandomNumber(32767) * 0.0000009155552842799158 - 0.015
+ double rndF = (double)g_fp->_rnd->getRandomNumber(32767) * 0.03 / 32767.0 - 0.015
+ atan2(bat2->currY - bat1->currY, bat2->currX - bat1->currX);
double rndCos = cos(rndF);
double rndSin = sin(rndF);
@@ -354,7 +354,7 @@ void sceneHandler27_knockBats(int bat1n, int bat2n) {
debugC(3, kDebugSceneLogic, "scene27: knockBats: bat1 to: powerCos: %f powerSin: %f", bat1->powerCos, bat1->powerSin);
- rndF = ((double)g_fp->_rnd->getRandomNumber(32767) * 0.0000009155552842799158 - 0.015
+ rndF = ((double)g_fp->_rnd->getRandomNumber(32767) * 0.03 / 32767.0 - 0.015
+ atan2(bat1->currY - bat2->currY, bat1->currX - bat2->currX));
double pow2x = cos(bat2->angle - rndF) * (double)((bat1->currX - bat2->currX) >= 0 ? 1 : -1) * bat2->power;
double pow2y = sin(bat2->angle - rndF) * (double)((bat1->currY - bat2->currY) >= 0 ? 1 : -1) * bat2->power;