refactor: submap - add middle points

This commit is contained in:
Azgaar 2024-10-26 14:27:37 +02:00
parent 1305246d7b
commit 3d79a527e2
3 changed files with 90 additions and 4 deletions

View file

@ -290,8 +290,8 @@ window.Routes = (function () {
const connectionModifier = connections.has(`${next}-${neibCellId}`) ? 1 : 2;
const burgModifier = cells.burg[neibCellId] ? 1 : 3;
const cellsCost = distanceCost * habitabilityModifier * heightModifier * connectionModifier * burgModifier;
const totalCost = priority + cellsCost;
const cellCost = distanceCost * habitabilityModifier * heightModifier * connectionModifier * burgModifier;
const totalCost = priority + cellCost;
if (totalCost >= cost[neibCellId]) continue;
from[neibCellId] = next;