Skip to content

Commit

Permalink
Fixed incorrect Arcade Physics circle separation logic for circle to …
Browse files Browse the repository at this point in the history
…circle, and circle to rectangle collisions. The logic was incorrectly moving only one body, even if both could be moved. Fix #6963
  • Loading branch information
photonstorm committed Jan 6, 2025
1 parent 5932dfc commit 9bb8003
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/physics/arcade/World.js
Original file line number Diff line number Diff line change
Expand Up @@ -1641,7 +1641,8 @@ var World = new Class({

body1.updateCenter();
}
else if (!body2Immovable || body2.pushable || deadlock)

if (!body2Immovable || body2.pushable || deadlock)
{
body2.x += overlapX;
body2.y += overlapY;
Expand All @@ -1664,7 +1665,8 @@ var World = new Class({

body1.updateCenter();
}
else if (!body2Immovable || body2.pushable || deadlock)

if (!body2Immovable || body2.pushable || deadlock)
{
body2.x += overlapX;
body2.y += overlapY;
Expand Down

0 comments on commit 9bb8003

Please sign in to comment.