feat(repair): mount Ebike on TestMap and snap repair to parked position
The Physique test scene now mounts the real Ebike component for the ebike repair zone, mirroring GameStageContent so the bike model and its interactions (mount/dismount, parked position tracking) are available when testing the repair flow. RepairGame derives its live world position from window.ebikeParkedPosition once the ebike mission leaves the locked/waiting phase, so the repair sequence happens wherever the player parked the bike rather than at the static zone anchor.
This commit is contained in:
@@ -72,8 +72,20 @@ export function RepairGame({
|
||||
const [scannedBrokenParts, setScannedBrokenParts] = useState<
|
||||
readonly RepairScannedBrokenPart[]
|
||||
>([]);
|
||||
// For the ebike mission, use the bike's live parked world position once
|
||||
// the repair flow leaves the waiting/locked phase so the repair happens
|
||||
// wherever the player parked the bike, not at the static zone anchor.
|
||||
// window.ebikeParkedPosition is set by Ebike when the player drops the
|
||||
// bike and stays stable through the rest of the repair flow.
|
||||
const livePosition = useMemo<Vector3Tuple>(() => {
|
||||
if (mission !== "ebike" || mainState !== mission) return position;
|
||||
if (step === "locked" || step === "waiting") return position;
|
||||
const parked = window.ebikeParkedPosition;
|
||||
if (!parked) return position;
|
||||
return [parked[0], parked[1], parked[2]];
|
||||
}, [mainState, mission, position, step]);
|
||||
const parsedScale = toVector3Scale(scale);
|
||||
const snappedPosition = useTerrainSnappedPosition(position);
|
||||
const snappedPosition = useTerrainSnappedPosition(livePosition);
|
||||
const readyForFragmentation = step === "inspected";
|
||||
const brokenNodeNames = useMemo(() => getBrokenNodeNames(config), [config]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user