Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exception thrown when get_next_expansion returns a null #171

Open
ericbroda opened this issue Nov 17, 2018 · 2 comments
Open

exception thrown when get_next_expansion returns a null #171

ericbroda opened this issue Nov 17, 2018 · 2 comments
Labels

Comments

@ericbroda
Copy link

When trying to expand, the function bot_ai.expand_now calls get_next_expansion which can return a null (will happen late in the game when no expansions are available), however, bot_ai.expand_now does not handle the null returned value.

There should be a check to see if there are any available expansion sites, and if there are not any available, then the null returned value (from get_next_expansion) should have handled without throwing an unexpected exception

@savelas
Copy link

savelas commented Dec 12, 2018

Similar thing happened to me.
File "C:\Users\s\sc2\bot_ai.py", line 139, in expand_now
await self.build(building, near=location, max_distance=max_distance, random_alternative=False, placement_step=1)
File "C:\Users\s\sc2\bot_ai.py", line 408, in build
p = await self.find_placement(building, near.rounded, max_distance, random_alternative, placement_step)
AttributeError: 'NoneType' object has no attribute 'rounded'

@BurnySc2 BurnySc2 added the bug label Dec 31, 2018
@danielvschoor
Copy link

I have also picked up an issue that might be related. On King's Cove LE, the "possible_points" generator in the BotAI.expansion_locations function is empty on one of the resources in resource_groups and the min function fails with "ValueError: min() arg is an empty sequence".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants