We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c4a6140 commit a6aefb0Copy full SHA for a6aefb0
client/src/components/sidebar/map-editor/MapGenerator.ts
@@ -123,6 +123,19 @@ function verifyMap(map: CurrentMap, bodies: Bodies): string {
123
if (numMoneyTowers !== 2) {
124
return `Expected exactly 2 money towers, found ${numMoneyTowers}`
125
}
126
+ for (const body of bodies.bodies.values()) {
127
+ // Check distance to nearby ruins
128
+
129
+ for (const checkRuin of map.staticMap.ruins) {
130
+ if (squareIntersects(checkRuin, body.pos, 2)) {
131
+ return (
132
+ `Tower at (${body.pos.x}, ${body.pos.y}) is too close to ruin ` +
133
+ `at (${checkRuin.x}, ${checkRuin.y}), must be ` +
134
+ `>= 3 away`
135
+ )
136
+ }
137
138
139
140
return ''
141
0 commit comments