Skip to content

Commit 9c755db

Browse files
committed
fix(chart): Official hold length calculation
1 parent 609f773 commit 9c755db

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/chart/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class GameChart {
106106
for (const note of data.notes) {
107107
if (note.type === 3) {
108108
const { isOfficial } = note;
109-
const holdLength = (isOfficial ? note.holdTime! / 1000 : note.holdLength!) * note.speed * sizer.height / sizer.noteScale;
109+
const holdLength = (isOfficial ? note.holdTime! * 0.0006 : note.holdLength!) * note.speed * sizer.height / sizer.noteScale;
110110

111111
note.sprite!.children[0].visible = true;
112112
note.sprite!.children[1].scale.y = 1;

src/chart/note.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export class GameChartNote {
180180
this.score.animationTime = null;
181181

182182
if (this.sprite && this.type === EGameChartNoteType.HOLD) {
183-
const holdLength = (this.isOfficial ? this.holdTime! / 1000 : this.holdLength!) * this.speed;
183+
const holdLength = (this.isOfficial ? this.holdTime! * 0.0006 : this.holdLength!) * this.speed;
184184

185185
this.sprite.children[0].visible = true;
186186
this.sprite.children[1].scale.y = 1;

src/chart/tick.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export function onChartTick(this: GameChart, currentTime: number, container: Con
170170
let realHoldLength = holdLength! * size.height / size.noteScale;
171171
if (time <= currentTime) {
172172
realHoldLength = (
173-
isOfficial ? (holdEndTime! - currentTime) / 1000 : (holdFloorPosition! - judgeline.floorPosition)
173+
isOfficial ? (holdEndTime! - currentTime) * 0.0006 : (holdFloorPosition! - judgeline.floorPosition)
174174
) * speed * size.height / size.noteScale;
175175

176176
const [ spriteHead, spriteBody, spriteEnd ] = sprite.children;

0 commit comments

Comments
 (0)