diff --git a/poetry.lock b/poetry.lock index 5d2c1a5..eb9c26f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1631,7 +1631,7 @@ numpy = "^2.0.0" type = "git" url = "https://github.com/raspersc2/SC2MapAnalysis" reference = "HEAD" -resolved_reference = "bcda693b54c4ecd7fa9a837ea29516e228e35aa7" +resolved_reference = "f30a95e116ae811cb3ecfbdd802c81d110885e7d" [[package]] name = "markdown" @@ -2725,13 +2725,13 @@ extra = ["pygments (>=2.12)"] [[package]] name = "pyparsing" -version = "3.2.0" +version = "3.2.1" description = "pyparsing module - Classes and methods to define and execute parsing grammars" optional = false python-versions = ">=3.9" files = [ - {file = "pyparsing-3.2.0-py3-none-any.whl", hash = "sha256:93d9577b88da0bbea8cc8334ee8b918ed014968fd2ec383e868fb8afb1ccef84"}, - {file = "pyparsing-3.2.0.tar.gz", hash = "sha256:cbf74e27246d595d9a74b186b810f6fbb86726dbf3b9532efb343f6d7294fe9c"}, + {file = "pyparsing-3.2.1-py3-none-any.whl", hash = "sha256:506ff4f4386c4cec0590ec19e6302d3aedb992fdc02c761e90416f158dacf8e1"}, + {file = "pyparsing-3.2.1.tar.gz", hash = "sha256:61980854fd66de3a90028d679a954d5f2623e83144b5afe5ee86f43d762e5f0a"}, ] [package.extras] diff --git a/src/ares/behaviors/macro/gas_building_controller.py b/src/ares/behaviors/macro/gas_building_controller.py index 528e38d..9e53a50 100644 --- a/src/ares/behaviors/macro/gas_building_controller.py +++ b/src/ares/behaviors/macro/gas_building_controller.py @@ -2,6 +2,7 @@ from typing import TYPE_CHECKING, Optional from cython_extensions import cy_distance_to_squared, cy_sorted_by_distance_to +from sc2.data import Race from sc2.position import Point2 from sc2.units import Units @@ -41,9 +42,13 @@ class GasBuildingController(MacroBehavior): closest_to: Optional[Point2] = None def execute(self, ai: "AresBot", config: dict, mediator: ManagerMediator) -> bool: - num_gas: int = ( - len(ai.gas_buildings) + mediator.get_building_counter[ai.gas_type] - ) + num_gas: int + if ai.race == Race.Terran: + num_gas = ai.not_started_but_in_building_tracker(ai.gas_type) + len( + ai.gas_buildings + ) + else: + num_gas = len(ai.gas_buildings) + mediator.get_building_counter[ai.gas_type] # we have enough gas / building gas then don't attempt behavior if ( num_gas >= self.to_count