minor bug fix affecting joubutsu

This commit is contained in:
Anthony Samms
2025-10-20 17:13:40 -04:00
parent 537f90555e
commit db18c1d801

View File

@@ -234,32 +234,29 @@ class Player:
TIMING_OK_EASY = 108.441665649414 TIMING_OK_EASY = 108.441665649414
TIMING_BAD_EASY = 125.125 TIMING_BAD_EASY = 125.125
def __init__(self, tja: Optional[TJAParser], player_number: int, difficulty: int): def __init__(self, tja: TJAParser, player_number: int, difficulty: int):
self.player_number = str(player_number) self.player_number = str(player_number)
self.difficulty = difficulty self.difficulty = difficulty
self.visual_offset = global_data.config["general"]["visual_offset"] self.visual_offset = global_data.config["general"]["visual_offset"]
if tja is not None: notes, self.branch_m, self.branch_e, self.branch_n = tja.notes_to_position(self.difficulty)
notes, self.branch_m, self.branch_e, self.branch_n = tja.notes_to_position(self.difficulty) self.play_notes, self.draw_note_list, self.draw_bar_list = apply_modifiers(notes)
self.play_notes, self.draw_note_list, self.draw_bar_list = apply_modifiers(notes) self.end_time = 0
if self.play_notes:
self.end_time = self.play_notes[-1].hit_ms self.end_time = self.play_notes[-1].hit_ms
if self.branch_m: if self.branch_m:
for section in self.branch_m: for section in self.branch_m:
if section.play_notes: if section.play_notes:
self.end_time = max(self.end_time, section.play_notes[-1].hit_ms) self.end_time = max(self.end_time, section.play_notes[-1].hit_ms)
if self.branch_e: if self.branch_e:
for section in self.branch_e: for section in self.branch_e:
if section.play_notes: if section.play_notes:
self.end_time = max(self.end_time, section.play_notes[-1].hit_ms) self.end_time = max(self.end_time, section.play_notes[-1].hit_ms)
if self.branch_n: if self.branch_n:
for section in self.branch_n: for section in self.branch_n:
if section.play_notes: if section.play_notes:
self.end_time = max(self.end_time, section.play_notes[-1].hit_ms) self.end_time = max(self.end_time, section.play_notes[-1].hit_ms)
else:
self.play_notes, self.draw_note_list, self.draw_bar_list = deque(), deque(), deque()
self.end_time = 0
notes = NoteList()
self.don_notes = deque([note for note in self.play_notes if note.type in {1, 3}]) self.don_notes = deque([note for note in self.play_notes if note.type in {1, 3}])
self.kat_notes = deque([note for note in self.play_notes if note.type in {2, 4}]) self.kat_notes = deque([note for note in self.play_notes if note.type in {2, 4}])