Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions e2e/track-edit-selection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ async function editClosedCircuit(page: Page, mobile: boolean, testInfo: TestInfo
await expect(rideInfo(page)).toContainText('Circuit complete');
await expect(selectionLine(page)).toContainText('Building from the end of the track');
await shot(page, testInfo, 'circuit-rebuilt', point);
// With nothing selected, Previous picks the last piece built: here the one that closed the gap.
await page.getByRole('button', { name: 'Previous piece' }).click();
await expect(selectionLine(page)).toContainText('Selected piece 7 of 14');
await page.getByRole('button', { name: 'Track end' }).click();
await expect(selectionLine(page)).toContainText('Building from the end of the track');

await toolbarAction(page, 'Resume');
await fastForward(page);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/coaster-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ export class CoasterPanel {
if (!snapshot || !decodeCursor(info[RideInfo.Cursor]).hasTrack) return -1;
for (let row = 0; row < snapshot.tracks.count; row++) {
const piece = snapshotPiece(snapshot, snapshot.trackLinks[row * TRACK_LINK_STRIDE]);
if (!piece || piece.rideId !== ride.id || piece.next >= 0) continue;
if (!piece || piece.rideId !== ride.id) continue;
const exit = pieceExit(piece.pieceType, piece.x, piece.y, piece.z, piece.dir);
if (
exit.x === info[RideInfo.CursorX] &&
Expand Down
Loading