Add optional chaining to probePlayerGround in third-person-navigation-controller.ts
This commit is contained in:
@@ -247,14 +247,14 @@ export class ThirdPersonNavigationController implements NavigationController {
|
|||||||
inFog: false
|
inFog: false
|
||||||
},
|
},
|
||||||
probeGround: (feetPosition, shape, maxDistance) =>
|
probeGround: (feetPosition, shape, maxDistance) =>
|
||||||
this.context?.probePlayerGround(feetPosition, shape, maxDistance) ?? {
|
this.context?.probePlayerGround?.(feetPosition, shape, maxDistance) ?? {
|
||||||
grounded: false,
|
grounded: false,
|
||||||
distance: null,
|
distance: null,
|
||||||
normal: null,
|
normal: null,
|
||||||
slopeDegrees: null
|
slopeDegrees: null
|
||||||
},
|
},
|
||||||
canOccupyShape: (feetPosition, shape) =>
|
canOccupyShape: (feetPosition, shape) =>
|
||||||
this.context?.canOccupyPlayerShape(feetPosition, shape) ?? true
|
this.context?.canOccupyPlayerShape?.(feetPosition, shape) ?? true
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user