From acb52256ec8b1775485fde8f2a03be0c66158af8 Mon Sep 17 00:00:00 2001 From: IMXNOOBX <69653071+IMXNOOBX@users.noreply.github.com> Date: Fri, 20 Oct 2023 21:27:08 +0200 Subject: [PATCH] Update update_offsets.py --- offsets/update_offsets.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/offsets/update_offsets.py b/offsets/update_offsets.py index e1136df..7184a2f 100644 --- a/offsets/update_offsets.py +++ b/offsets/update_offsets.py @@ -16,8 +16,12 @@ build_number = 0 if response.status_code == 200: commit_data = response.json() if commit_data: - last_commit_message = commit_data[0]['commit']['message'] - build_number = last_commit_message.split()[-1] + for commit in commit_data: + commit_message = commit['commit']['message'] + build_match = re.search(r'\bGame Update (\d+)(?: \(\d+\))?\b', commit_message) + if build_match: + build_number = int(build_match.group(1)) + break with open(dest_path, 'r') as dest_file: dest_data = json.load(dest_file)