From 903dfabf4cefe48648756c76373bffbdf9583bdb Mon Sep 17 00:00:00 2001 From: Yorick van Klinken Date: Thu, 20 Jun 2024 20:28:05 +0200 Subject: [PATCH] ref: Simplified contains BoundingBox code (#3096) The `if` didn't seem that useful anymore --- src/engine/Collision/BoundingBox.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/engine/Collision/BoundingBox.ts b/src/engine/Collision/BoundingBox.ts index c8613d407..62bb82562 100644 --- a/src/engine/Collision/BoundingBox.ts +++ b/src/engine/Collision/BoundingBox.ts @@ -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; }