File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -193,10 +193,16 @@ def _find_expansion_locations(self):
193193 # Check if any pair of resource of these groups is closer than threshold together
194194 # And that they are on the same terrain level
195195 if any (
196- resource_a .distance_to (resource_b ) <= resource_spread_threshold
197- and height_grid [resource_a .position .rounded ]
198- == height_grid [resource_b .position .rounded ]
199- for resource_a , resource_b in itertools .product (group_a , group_b )
196+ resource_a .distance_to (resource_b ) <= resource_spread_threshold
197+ # check if terrain height measurement at resources is within 10 units
198+ # this is since some older maps have inconsistent terrain height
199+ # tiles at certain expansion locations
200+ and abs (
201+ height_grid [resource_a .position .rounded ]
202+ - height_grid [resource_b .position .rounded ]
203+ )
204+ <= 10
205+ for resource_a , resource_b in itertools .product (group_a , group_b )
200206 ):
201207 # Remove the single groups and add the merged group
202208 resource_groups .remove (group_a )
You can’t perform that action at this time.
0 commit comments