Skip to content

Commit

Permalink
Fix copying CCBs in edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
Axionize committed Nov 21, 2024
1 parent 1dc4361 commit 26a771e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ public boolean isIntersected(SimpleCollisionBox other) {

@Override
public CollisionBox copy() {
return new ComplexCollisionBox(boxes.length, boxes);
ComplexCollisionBox copy = new ComplexCollisionBox(boxes.length);
for (int i = 0; i < maxLength; i++) {
copy.boxes[i] = boxes[i].copy();
}
copy.maxLength = this.maxLength;
return copy;
}

@Override
Expand Down

0 comments on commit 26a771e

Please sign in to comment.