Add optional chaining to probePlayerGround in first-person-navigation-controller.ts

This commit is contained in:
2026-04-11 18:42:32 +02:00
parent d6c021616a
commit cb04633a6a

View File

@@ -275,14 +275,14 @@ export class FirstPersonNavigationController implements NavigationController {
inFog: false
},
probeGround: (feetPosition, shape, maxDistance) =>
this.context?.probePlayerGround(feetPosition, shape, maxDistance) ?? {
this.context?.probePlayerGround?.(feetPosition, shape, maxDistance) ?? {
grounded: false,
distance: null,
normal: null,
slopeDegrees: null
},
canOccupyShape: (feetPosition, shape) =>
this.context?.canOccupyPlayerShape(feetPosition, shape) ?? true
this.context?.canOccupyPlayerShape?.(feetPosition, shape) ?? true
}
);