Skip to content

Commit

Permalink
Match bots rear and front wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
oldnapalm committed Jan 22, 2024
1 parent f6ab200 commit 22fac8e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions zwift_offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,16 @@ def load_game_dictionary():
gd['bikeshoes'] = [int(x.get('signature')) for x in root.findall("./BIKESHOES/BIKESHOE")]
gd['socks'] = [int(x.get('signature')) for x in root.findall("./SOCKS/SOCK")]
gd['jerseys'] = [int(x.get('signature')) for x in root.findall("./JERSEYS/JERSEY")]
gd['bikefrontwheels'] = [int(x.get('signature')) for x in root.findall("./BIKEFRONTWHEELS/BIKEFRONTWHEEL")]
gd['bikerearwheels'] = [int(x.get('signature')) for x in root.findall("./BIKEREARWHEELS/BIKEREARWHEEL")]
frontwheels = {}
for x in root.findall("./BIKEFRONTWHEELS/BIKEFRONTWHEEL"):
frontwheels[x.get('name')] = int(x.get('signature'))
rearwheels = {}
for x in root.findall("./BIKEREARWHEELS/BIKEREARWHEEL"):
rearwheels[x.get('name')] = int(x.get('signature'))
gd['wheels'] = []
for wheel in rearwheels:
if wheel in frontwheels:
gd['wheels'].append((rearwheels[wheel], frontwheels[wheel]))
gd['runshirts'] = [int(x.get('signature')) for x in root.findall("./RUNSHIRTS/RUNSHIRT")]
gd['runshorts'] = [int(x.get('signature')) for x in root.findall("./RUNSHORTS/RUNSHORT")]
gd['runshoes'] = [int(x.get('signature')) for x in root.findall("./RUNSHOES/RUNSHOE")]
Expand Down Expand Up @@ -1966,8 +1974,7 @@ def random_profile(p):
p.ride_shoes_type = random.choice(GD['bikeshoes'])
p.ride_socks_type = random.choice(GD['socks'])
p.ride_jersey = random.choice(GD['jerseys'])
p.bike_wheel_front = random.choice(GD['bikefrontwheels'])
p.bike_wheel_rear = random.choice(GD['bikerearwheels'])
p.bike_wheel_rear, p.bike_wheel_front = random.choice(GD['wheels'])
p.bike_frame = random.choice(list(GD['bikeframes'].keys()))
p.run_shirt_type = random.choice(GD['runshirts'])
p.run_shorts_type = random.choice(GD['runshorts'])
Expand Down

0 comments on commit 22fac8e

Please sign in to comment.