Skip to content

Commit b85a01a

Browse files
committed
Important Tentacles Update
Prior to this, tentacles questions did not include nodes due to a bug. Hopefully this does not affect any games.
1 parent 973ef5e commit b85a01a

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

src/maps/api.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ const tentacleFirstTag: { [key in TentacleLocations]: "amenity" | "tourism" } =
105105
export const findTentacleLocations = async (question: TentacleQuestion) => {
106106
const query = `
107107
[out:json][timeout:25];
108-
nw["${tentacleFirstTag[question.locationType]}"="${
108+
nwr["${locationFirstTag[question.locationType]}"="${
109109
question.locationType
110110
}"](around:${turf.convertLength(
111111
question.radius,
@@ -125,6 +125,24 @@ out center;
125125

126126
elements.forEach((element: any) => {
127127
if (!element.tags["name"] && !element.tags["name:en"]) return;
128+
129+
if (element.lat && element.lon) {
130+
const name = element.tags["name:en"] ?? element.tags["name"];
131+
132+
if (
133+
response.features.find(
134+
(feature: any) => feature.properties.name === name,
135+
)
136+
)
137+
return;
138+
139+
response.features.push(
140+
turf.point([element.lon, element.lat], {
141+
name,
142+
}),
143+
);
144+
}
145+
128146
if (!element.center || !element.center.lon || !element.center.lat)
129147
return;
130148

0 commit comments

Comments
 (0)