Open yanntm opened 6 years ago
The code is non intrusive w.r.t. to the existing code structure so I hope that helps the PR go through. The only thing I'm not really sure about is that 1.0f squared 2D distance, but obviously I don't want any == on floats. It worked in practice on ladder maps where the previous function had erroneous reporting.
If there is already a building, or, e.g. creep in a location, the placement queries for a CommandCenter (line 19) will answer false. In the onStart method of a bot, it is likely that your own initial base is blocking at least one expansion location. This led to the algorithm returning points way off the map, or in e.g. (0,0). With this patch, we a posteriori edit the results of the query, so that an existing CC/Hatch/Nexus still counts as a good location to build in.