Skip to content

Commit f1ec9ee

Browse files
committed
fix: C2sParser.ParseNote ALD/ASD Cell/Width 错误赋值
重构为各分支独立设置字段,ALD/ASD 不再从 p[3]/p[4] 误设 Cell/Width
1 parent 7f19976 commit f1ec9ee

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

parser/chu/C2sParser.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,25 @@ private static void ParseTiming(string[] p, C2sChart chart)
8686
private static void ParseNote(string[] p, C2sChart chart, List<Alert> alerts, int lineNum)
8787
{
8888
var tag = p[0].ToUpperInvariant();
89-
var note = new ChuNote { Type = tag, Measure = Int(p, 1), Offset = Int(p, 2), Cell = Int(p, 3), Width = Math.Max(1, Int(p, 4, 1)) };
89+
var note = new ChuNote { Type = tag, Measure = Int(p, 1), Offset = Int(p, 2) };
9090

9191
switch (tag)
9292
{
93-
case "TAP": case "MNE": break;
94-
case "CHR": note.Extra = Str(p, 5); break;
95-
case "HLD": case "HXD": note.HoldDuration = Int(p, 5); break;
93+
case "TAP": case "MNE":
94+
note.Cell = Int(p, 3); note.Width = Math.Max(1, Int(p, 4, 1)); break;
95+
case "CHR":
96+
note.Cell = Int(p, 3); note.Width = Math.Max(1, Int(p, 4, 1)); note.Extra = Str(p, 5); break;
97+
case "HLD": case "HXD":
98+
note.Cell = Int(p, 3); note.Width = Math.Max(1, Int(p, 4, 1)); note.HoldDuration = Int(p, 5); break;
9699
case "SLD": case "SLC": case "SXD": case "SXC":
100+
note.Cell = Int(p, 3); note.Width = Math.Max(1, Int(p, 4, 1));
97101
note.SlideDuration = Int(p, 5); note.EndCell = Int(p, 6); note.EndWidth = Math.Max(1, Int(p, 7, 1)); break;
98-
case "FLK": note.Extra = Str(p, 5); break;
102+
case "FLK":
103+
note.Cell = Int(p, 3); note.Width = Math.Max(1, Int(p, 4, 1)); note.Extra = Str(p, 5); break;
99104
case "AIR": case "AUR": case "AUL": case "ADW": case "ADR": case "ADL":
100-
note.TargetNote = Str(p, 5); break;
105+
note.Cell = Int(p, 3); note.Width = Math.Max(1, Int(p, 4, 1)); note.TargetNote = Str(p, 5); break;
101106
case "AHD":
107+
note.Cell = Int(p, 3); note.Width = Math.Max(1, Int(p, 4, 1));
102108
note.TargetNote = Str(p, 5); note.AirHoldDuration = Int(p, 6); break;
103109
case "ALD": case "ASD":
104110
note.StartHeight = Int(p, 3); note.SlideDuration = Int(p, 4);

0 commit comments

Comments
 (0)