aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/fullpipe/scenes/scene27.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/fullpipe/scenes/scene27.cpp b/engines/fullpipe/scenes/scene27.cpp
index 3d5106690b..e8c9db0fb7 100644
--- a/engines/fullpipe/scenes/scene27.cpp
+++ b/engines/fullpipe/scenes/scene27.cpp
@@ -339,9 +339,13 @@ bool sceneHandler27_batFallLogic(int bat) {
}
bool sceneHandler27_batCalcDistance(int bat1, int bat2) {
- warning("STUB: sceneHandler27_batCalcDistance()");
+ double at = atan2(g_vars->scene27_bats[bat1]->currX - g_vars->scene27_bats[bat2]->currX, g_vars->scene27_bats[bat1]->currY - g_vars->scene27_bats[bat2]->currY);
+ double dy = g_vars->scene27_bats[bat1]->currY - g_vars->scene27_bats[bat2]->currY;
+ double dx = g_vars->scene27_bats[bat1]->currX - g_vars->scene27_bats[bat2]->currX;
+ double ay = cos(at);
+ double ax = sin(at);
- return false;
+ return sqrt(ax * ax * 0.25 + ay * ay) * 54.0 > sqrt(dx * dx + dy * dy);
}
void sceneHandler27_knockBats(int bat1, int bat2) {