From ff6a9386c7f4c0d2ad46899cdfd3746947eef61b Mon Sep 17 00:00:00 2001 From: Jakads Date: Sat, 9 Nov 2019 04:00:54 +0900 Subject: [PATCH] do a better job at ignoring other than bpm --- src/catch.py | 2 +- src/mania.py | 9 +++++---- src/std.py | 11 ++++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/catch.py b/src/catch.py index 4ee9880..90e1997 100644 --- a/src/catch.py +++ b/src/catch.py @@ -105,7 +105,7 @@ def randosu(path, content): # If factor is too high, corner the object, but only if it's truly impossible prevx = randnotes[i-1]['x'] - if abs(diffx) * minsf > max([prevx, 512-prevx]): + if abs(diffx) * minsf > max(prevx, 512-prevx): if randx < 0: randx = 0 if randx > 512: diff --git a/src/mania.py b/src/mania.py index 5fb15af..7e03cab 100644 --- a/src/mania.py +++ b/src/mania.py @@ -27,13 +27,14 @@ def randosu(path, content): # Parse BPMs from the next row of [TimingPoints] to [HitObjects] for c in content[bpmindex+1:objindex]: - # Ignore comments and blanks - if c.startswith('//') or c == '\n': - continue - # BPM Points: ms,60000/BPM,[],[],[],[],1,[] # 60000/BPM = ms per beat content_split = c.split(',') + + # Ignore comments and others + if c.startswith('//') or len(content_split) != 8: + continue + if content_split[6] == '1': bpms.append({ # {ms, mpb} diff --git a/src/std.py b/src/std.py index 646e1ca..a4dc428 100644 --- a/src/std.py +++ b/src/std.py @@ -27,20 +27,21 @@ def randosu(path, content): # Parse BPMs from the next row of [TimingPoints] to [HitObjects] for c in content[bpmindex+1:objindex]: - # Ignore comments and blanks - if c.startswith('//') or c == '\n': - continue - # BPM Points: ms,60000/BPM,[],[],[],[],1,[] # 60000/BPM = ms per beat content_split = c.split(',') + + # Ignore comments and others + if c.startswith('//') or len(content_split) != 8: + continue + if content_split[6] == '1': bpms.append({ # {ms, mpb} 'ms': float(content_split[0]), 'mpb': float(content_split[1]) }) - print('h') + # Parse notes from the next row of [HitObjects] to EOF for c in content[objindex+1:]: # Ignore comments and blanks