1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-22 17:07:40 +08:00

Fix incorrect EndTimes when processing has not been run on HitObjects before the SongProgressGraph is displayed.

This commit is contained in:
Dean Herbert 2017-04-19 16:02:51 +09:00
parent 83fa143e17
commit 2783f49267
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49

View File

@ -20,9 +20,12 @@ namespace osu.Game.Screens.Play
const int granularity = 200;
var lastHit = ((objects.Last() as IHasEndTime)?.EndTime ?? objects.Last().StartTime) + 1;
var lastHit = (objects.Last() as IHasEndTime)?.EndTime ?? 0;
var interval = lastHit / granularity;
if (lastHit == 0)
lastHit = objects.Last().StartTime;
var interval = (lastHit + 1) / granularity;
var values = new int[granularity];
@ -31,7 +34,7 @@ namespace osu.Game.Screens.Play
IHasEndTime end = h as IHasEndTime;
int startRange = (int)(h.StartTime / interval);
int endRange = (int)((end?.EndTime ?? h.StartTime) / interval);
int endRange = (int)((end?.EndTime > 0 ? end.EndTime : h.StartTime) / interval);
for (int i = startRange; i <= endRange; i++)
values[i]++;
}