Files
0ad/binaries/data
Fabio Pedretti f08832b60d Search the closest water point among boundary points only
Area.getClosestPointTo scans every point of the water search area, and
it was called up to count * retryFactor times in placeDocks.

The nearest point of a set to a point outside of it is always a
boundary point, so compute the boundary once and scan only that. The
logic lives in two small helpers, getBoundaryPoints (Uint8Array mask
based) and getClosestPointInList, so it can be reused and read apart
from placeDocks. getBoundaryPoints returns the original point objects,
while getClosestPointInList returns a clone of the point it finds, so
callers cannot mutate the points stored in the list.
2026-10-15 16:55:16 +02:00
..
…