Skip to content

Commit 832ca82

Browse files
committed
enforce cat waypoints when exporting map
1 parent 149d58f commit 832ca82

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

client/src/components/sidebar/map-editor/MapGenerator.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Game, { Team } from '../../../playback/Game'
33
import Match from '../../../playback/Match'
44
import { CurrentMap, StaticMap } from '../../../playback/Map'
55
import Round from '../../../playback/Round'
6-
import Bodies from '../../../playback/Bodies'
6+
import Bodies, { Body } from '../../../playback/Bodies'
77
import { BATTLECODE_YEAR, DIRECTIONS, TEAM_COLOR_NAMES } from '../../../constants'
88
import { nativeAPI } from '../runner/native-api-wrapper'
99
import { Vector } from '../../../playback/Vector'
@@ -180,6 +180,13 @@ function verifyMap(map: CurrentMap, bodies: Bodies): string {
180180
`>= 3 away`
181181
)
182182
}
183+
184+
if (body.robotType === schema.RobotType.CAT) {
185+
if (!map.staticMap.catWaypoints.get(body.id) || map.staticMap.catWaypoints.get(body.id)?.length === 0) {
186+
return `Cat with id ${body.id} has no waypoints`
187+
}
188+
}
189+
183190
}
184191

185192
return ''

0 commit comments

Comments
 (0)