Hotfix: .at is not a function error

This commit is contained in:
uwap 2026-01-03 17:24:06 +01:00
parent f8031af424
commit a725a729a7
2 changed files with 7 additions and 7 deletions

View file

@ -190,10 +190,11 @@ export default profiler.registerFN(function (room: Room) {
// Build Roads + Containers
const roadTargets = (room.sources as (_HasRoomPosition | null)[])
.concat([room.controller, room.mineral])
.concat([room.find(FIND_EXIT_TOP).at(0),
room.find(FIND_EXIT_LEFT).at(0),
room.find(FIND_EXIT_RIGHT).at(0),
room.find(FIND_EXIT_BOTTOM).at(0)]
.concat((room.find(FIND_EXIT_TOP).slice(0, 1))
.concat(room.find(FIND_EXIT_LEFT).slice(0, 1))
.concat(room.find(FIND_EXIT_RIGHT).slice(0, 1))
.concat(room.find(FIND_EXIT_BOTTOM).slice(0, 1))
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
.map(pos => pos != null ? ({ pos }) : null));
for (const target of roadTargets) {
if (target == null) {

View file

@ -23,12 +23,11 @@
},
"include": [
"next-env.d.ts",
"src/**/*.ts",
"src/**/*.tsx",
"**/*.ts",
"**/*.tsx",
],
"exclude": [
"node_modules",
"deps",
"dist",
]
}