fix: rlclient update resource gathering and map name

fix: #7540
This commit is contained in:
Langbart 2025-01-23 11:06:17 +01:00 committed by Dunedan
parent 064ab14577
commit dffa892c60
3 changed files with 11 additions and 5 deletions

View file

@ -8,7 +8,7 @@
"VictoryConditions": [
"conquest_units"
],
"Name": "Arcadia",
"mapName": "Arcadia",
"mapType": "scenario",
"AISeed": 0,
"Seed": 0,

View file

@ -53,7 +53,13 @@ def test_gather():
collect_wood = zero_ad.actions.gather([female_citizen], nearby_tree)
state = game.step([collect_wood])
while len(state.unit(female_citizen.id()).data["resourceCarrying"]) == 0:
while (
game.evaluate(
f"Engine.QueryInterface({female_citizen.id()}, "
f"IID_ResourceGatherer).GetCarryingStatus().length"
)
== 0
):
state = game.step()

View file

@ -33,9 +33,9 @@ def test_return_string():
def test_fastactions():
state = game.reset(config)
game.evaluate(fastactions)
female_citizens = state.units(owner=1, type="female_citizen")
female_citizens = state.units(owner=1, entity_type="female_citizen")
house_tpl = "structures/spart/house"
len(state.units(owner=1, type=house_tpl))
len(state.units(owner=1, entity_type=house_tpl))
x = 680
z = 640
build_house = zero_ad.actions.construct(female_citizens, house_tpl, x, z, autocontinue=True)
@ -43,7 +43,7 @@ def test_fastactions():
state = game.step([build_house])
def new_house(_=None):
return state.units(owner=1, type=house_tpl)[0]
return state.units(owner=1, entity_type=house_tpl)[0]
initial_health = new_house().health(ratio=True)
while new_house().health(ratio=True) == initial_health: