Fix mouseX legacy replay parsing for high key counts in mania

This commit is contained in:
clayton 2024-08-11 09:45:43 -07:00
parent 2233602184
commit 9620c58751
No known key found for this signature in database
GPG Key ID: 0E5962B8D84F9B2E
1 changed files with 4 additions and 1 deletions

View File

@ -280,8 +280,11 @@ private void readLegacyReplay(Replay replay, StreamReader reader)
continue;
}
// In mania, mouseX encodes the pressed keys in the lower 20 bits
int mouseXParseLimit = currentRuleset.RulesetInfo.OnlineID == 3 ? (1 << 20) - 1 : Parsing.MAX_COORDINATE_VALUE;
float diff = Parsing.ParseFloat(split[0]);
float mouseX = Parsing.ParseFloat(split[1], Parsing.MAX_COORDINATE_VALUE);
float mouseX = Parsing.ParseFloat(split[1], mouseXParseLimit);
float mouseY = Parsing.ParseFloat(split[2], Parsing.MAX_COORDINATE_VALUE);
lastTime += diff;