fix: display right background based on travelled distance
authorxangelo <me@xangelo.ca>
Fri, 28 Jul 2023 18:49:31 +0000 (14:49 -0400)
committerxangelo <me@xangelo.ca>
Fri, 28 Jul 2023 18:49:31 +0000 (14:49 -0400)
src/server/api.ts

index fb4492a66eda08740d3fd74d3ab753f6d41fc498..aed47d41831d8261459b751175a2fe31f6784e31 100644 (file)
@@ -548,7 +548,7 @@ app.get('/state', authEndpoint, async (req: Request, res: Response) => {
   const travelPlan = await getTravelPlan(player.id);
 
   if(travelPlan) {
-    closestTown = (travelPlan.current_position / travelPlan.total_distance) > 0.5 ? travelPlan.source_id : travelPlan.destination_id;
+    closestTown = (travelPlan.current_position / travelPlan.total_distance) > 0.5 ? travelPlan.destination_id : travelPlan.source_id;
   }
   
   const state = {