mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-11-08 10:29:00 +00:00
Create the water search area first and return before computing the land search area if there is no water at all, so that work is not wasted. Also return if the land search area is empty. Previously pickRandom would have been called on an empty array and returned undefined, making getClosestPointTo fail on an undefined position. Cache the start points instead of calling getPoints() on every try.