You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When no more mineral fields are left, an assertion exception is thrown
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/sc2/main.py", line 144, in _play_game_ai
await ai.on_step(iteration)
File "./main.py", line 500, in on_step
await self.distribute_workers()
File "/usr/local/lib/python3.7/site-packages/sc2/bot_ai.py", line 276, in distribute_workers
mf = self.state.mineral_field.closest_to(idle_worker)
File "/usr/local/lib/python3.7/site-packages/sc2/units.py", line 163, in closest_to
assert self, "Units object is empty"
AssertionError: Units object is empty
The text was updated successfully, but these errors were encountered:
thank you for this report.
the distribute workers function is far from optimal and mostly just to get you started without having to worry about worker micro when you start to write a bot
if you want to have something that is more polished, you will have to write your own function for this
i will change this to be safe for lategame scenarios with no minerals left, but keep in mind that this function is not perfect and never will be.
python-sc2/sc2/bot_ai.py
Line 275 in caf05ae
When no more mineral fields are left, an assertion exception is thrown
The text was updated successfully, but these errors were encountered: