Skip to content

Commit

Permalink
Simplified contains BoundingBox code
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 15, 2024
1 parent b57684c commit 680d161
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 680d161

Please sign in to comment.