Skip to content

Commit

Permalink
quick fix: no bounding box for collision issue
Browse files Browse the repository at this point in the history
  • Loading branch information
xesf committed Feb 28, 2024
1 parent 6e1618c commit 09e6bf3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/game/scenery/island/IslandPhysics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,11 @@ function processBoxIntersections(
) {
const boundingBox = obj.model || obj instanceof Extra
? obj.model.boundingBox
: obj.sprite.boundingBox;
: obj.sprite?.boundingBox;
// still need to investigate better why both model and sprites are null
if (!boundingBox) {
return isTouchingGround;
}
ACTOR_BOX.copy(boundingBox);
ACTOR_BOX.translate(position);
let collision = false;
Expand Down

0 comments on commit 09e6bf3

Please sign in to comment.