Skip to content

Commit

Permalink
do a better job at ignoring other than bpm
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakads committed Nov 8, 2019
1 parent 325aedf commit ff6a938
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/catch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 5 additions & 4 deletions src/mania.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
11 changes: 6 additions & 5 deletions src/std.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ff6a938

Please sign in to comment.