Previously, the Refinery placement check would first collect all cells with resources inside the MaxBaseRadius, then perform a full findPos check for each cell until one of them would not return null. The problem was that if all of the cells returned null (for example if there wasn't enough space between base center and resource, or if all suitable space was otherwise occupied), it would basically check all tiles with resources only to fail finding a suitable position and fall back to the normal findPos check. Since nearbyResources already performs a shuffle, I simply made the check use the first cell from the list and use the basic findPos fallback if that cell is null. Closes #4717.
36 KiB
36 KiB