Open DrKwojn opened 7 months ago
Description for function BotAI.research states that the result should only be True if the upgrade was started. But the function will return True even if the research is not started because of the structure needed to research the upgrade not being finished. https://github.com/BurnySc2/python-sc2/blob/f175e8160762dcba9a1524b3491cf5f522e01fde/sc2/bot_ai.py#L1080-L1085
The problem seems to be that the condition checking for an available structure to do the research does not check if the structure has finished building. https://github.com/BurnySc2/python-sc2/blob/f175e8160762dcba9a1524b3491cf5f522e01fde/sc2/bot_ai.py#L1136-L1152
self.research(UpgradeId.ZERGMISSILEWEAPONSLEVEL1)
Will return True if there is only one evolution chamber and if it is not finished, but it should be False.
self.research(UpgradeId.GLIALRECONSTITUTION)
Will return True if there is only one roach warren and if it is not finished, but it should be False.
Adding and structure.is_ready in the condition checking for an available structure would solve the issue. Not sure if there are any problems with this. https://github.com/BurnySc2/python-sc2/blob/f175e8160762dcba9a1524b3491cf5f522e01fde/sc2/bot_ai.py#L1138-L1147
and structure.is_ready
Version burnysc2 6.5.0
Description for function BotAI.research states that the result should only be True if the upgrade was started. But the function will return True even if the research is not started because of the structure needed to research the upgrade not being finished. https://github.com/BurnySc2/python-sc2/blob/f175e8160762dcba9a1524b3491cf5f522e01fde/sc2/bot_ai.py#L1080-L1085
The problem seems to be that the condition checking for an available structure to do the research does not check if the structure has finished building. https://github.com/BurnySc2/python-sc2/blob/f175e8160762dcba9a1524b3491cf5f522e01fde/sc2/bot_ai.py#L1136-L1152
Example 1:
Will return True if there is only one evolution chamber and if it is not finished, but it should be False.
Example 2:
Will return True if there is only one roach warren and if it is not finished, but it should be False.
Possible solution
Adding
and structure.is_ready
in the condition checking for an available structure would solve the issue. Not sure if there are any problems with this. https://github.com/BurnySc2/python-sc2/blob/f175e8160762dcba9a1524b3491cf5f522e01fde/sc2/bot_ai.py#L1138-L1147Version burnysc2 6.5.0