From 8c450bf2fc52d9405c6a47834541ff805803980f Mon Sep 17 00:00:00 2001 From: oldnapalm <38410858+oldnapalm@users.noreply.github.com> Date: Tue, 26 Sep 2023 09:36:26 -0300 Subject: [PATCH] Avoid repeated positions when using bot multiplier (riders with identical positions will be filtered out by the client) --- standalone.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/standalone.py b/standalone.py index 78ad328d..6cbf82e8 100644 --- a/standalone.py +++ b/standalone.py @@ -570,6 +570,7 @@ def load_bots(): for (root, dirs, files) in os.walk(path): for f in files: if f.endswith('.bin'): + positions = [] for n in range(0, multiplier): p = profile_pb2.PlayerProfile() p.CopyFrom(zo.random_profile(p)) @@ -580,9 +581,11 @@ def load_bots(): bot.route = udp_node_msgs_pb2.Ghost() with open(os.path.join(root, f), 'rb') as fd: bot.route.ParseFromString(fd.read()) + positions = list(range(len(bot.route.states))) + random.shuffle(positions) else: bot.route = global_bots[i + 1000000].route - bot.position = random.randrange(len(bot.route.states)) + bot.position = positions.pop() if not loop_riders: loop_riders = data['riders'].copy() random.shuffle(loop_riders)