Skip to content

Commit

Permalink
fix: platformEffector shouldCollide this argument (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
dragoncoder047 authored Oct 22, 2024
1 parent 629597f commit df66174
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/physics/effectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export type PlatformEffectorCompOpt = {
* If present, it overrides the `ignoreSides`; if absent, it is
* automatically created from `ignoreSides`.
*/
shouldCollide?: (obj: GameObj, normal: Vec2) => boolean
shouldCollide?: (this: GameObj<PlatformEffectorComp>, obj: GameObj, normal: Vec2) => boolean
};

export interface PlatformEffectorComp extends Comp {
Expand Down Expand Up @@ -195,7 +195,7 @@ export function platformEffector(
if (this.platformIgnore.has(collision.target)) {
collision.preventResolution();
}
else if (!opt.shouldCollide!(collision.target, collision.normal)) {
else if (!opt.shouldCollide!.call(this, collision.target, collision.normal)) {
collision.preventResolution();
this.platformIgnore.add(collision.target);
}
Expand Down

0 comments on commit df66174

Please sign in to comment.