Skip to content

Commit

Permalink
ref: Simplified contains BoundingBox code (#3096)
Browse files Browse the repository at this point in the history
The `if` didn't seem that useful anymore
  • Loading branch information
Autsider666 authored Jun 20, 2024
1 parent 409e979 commit 903dfab
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/engine/Collision/BoundingBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,7 @@ export class BoundingBox {
if (val instanceof Vector) {
return this.left <= val.x && this.top <= val.y && this.bottom >= val.y && this.right >= val.x;
} else if (val instanceof BoundingBox) {
if (this.left <= val.left && this.top <= val.top && val.bottom <= this.bottom && val.right <= this.right) {
return true;
}
return false;
return this.left <= val.left && this.top <= val.top && val.bottom <= this.bottom && val.right <= this.right;
}
return false;
}
Expand Down

0 comments on commit 903dfab

Please sign in to comment.