Skip to content

Commit 43e2f67

Browse files
committed
Fix entered_colors()
1 parent 4ae4a4c commit 43e2f67

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/bundles/robot_minigame/functions.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,10 +435,11 @@ export function entered_colors(
435435
// Testing functions should only run after the simulation is complete
436436
if (!state.isComplete) return false;
437437

438-
return state.areaLog
438+
const coloredAreas = state.areaLog
439439
.filter(area => colors.includes(area.flags.color)) // Filter relevant colors
440-
.filter(filterAdjacentDuplicateAreas) // Filter adjacent duplicates
441-
.every(({ flags: { color } }, i) => color === colors[i]); // Check if each area has the expected color
440+
.filter(filterAdjacentDuplicateAreas); // Filter adjacent duplicates
441+
442+
return coloredAreas.length === colors.length && coloredAreas.every(({ flags: { color } }, i) => color === colors[i]); // Check if each area has the expected color
442443
}
443444

444445
// ==================

0 commit comments

Comments
 (0)