From 69e81438062453883e188e8a498f83cc31f64ad5 Mon Sep 17 00:00:00 2001 From: Matthew Pierce Date: Mon, 30 Mar 2020 13:42:43 +0100 Subject: [PATCH] Fixed bug where all contacts were deemed standard --- Ball.pde | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ball.pde b/Ball.pde index 0ceb427..145d358 100644 --- a/Ball.pde +++ b/Ball.pde @@ -133,7 +133,7 @@ class Ball { float dist = sqrt(dx*dx+dy*dy); boolean currentCanMove = velocity.x != 0.0 && velocity.y != 0.0; boolean otherCanMove = other.velocity.x != 0.0 && other.velocity.y != 0.0; - if(dist < Constants.Simulator.RADIUS + Constants.Simulator.RADIUS) { + if(dist < Constants.Simulator.RADIUS + Constants.Simulator.RADIUS && currentCanMove && otherCanMove) { updatePosition(other,dx,dy); updateInfected(other); } else if (dist < Constants.Simulator.RADIUS + Constants.Simulator.RADIUS && currentCanMove && !otherCanMove) {