From d6af0199c95561e54681aa8132073218012ea4a8 Mon Sep 17 00:00:00 2001 From: cha0s Date: Mon, 5 Aug 2024 03:21:11 -0500 Subject: [PATCH] fix: context entities --- app/ecs/components/collider.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/ecs/components/collider.js b/app/ecs/components/collider.js index 5790c7a..f550111 100644 --- a/app/ecs/components/collider.js +++ b/app/ecs/components/collider.js @@ -106,6 +106,7 @@ export default class Collider extends Component { if (!hasMatchingIntersection) { if (this.$$collisionStart) { const script = this.$$collisionStart.clone(); + script.context.entity = thisEntity; script.context.other = otherEntity; script.context.pair = [body, otherBody]; const ticker = script.ticker(); @@ -115,6 +116,7 @@ export default class Collider extends Component { } if (other.$$collisionStart) { const script = other.$$collisionStart.clone(); + script.context.entity = otherEntity; script.context.other = thisEntity; script.context.pair = [otherBody, body]; const ticker = script.ticker(); @@ -271,14 +273,12 @@ export default class Collider extends Component { instance.collisionEndScript, { ecs: this.ecs, - entity: this.ecs.get(instance.entity), }, ); instance.$$collisionStart = await this.ecs.readScript( instance.collisionStartScript, { ecs: this.ecs, - entity: this.ecs.get(instance.entity), }, ); }