Skip to content

Commit

Permalink
bmson: Workaround for misinterpret total values
Browse files Browse the repository at this point in the history
  • Loading branch information
GoaLitiuM committed Oct 4, 2016
1 parent 077dcd1 commit c44ebe2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Pulsus/Gameplay/BMSON/BMSONChart.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Pulsus.Audio;
using System;
using System.Collections.Generic;
using System.IO;
using System;
using Pulsus.Audio;

namespace Pulsus.Gameplay
{
Expand All @@ -14,7 +14,7 @@ public class BMSONChart : Chart
public override int rank { get { return rankLegacy; } }
public override double rankMultiplier { get { return rankMultiplierReal; } }
public override double gaugeTotal { get { return 0.0; } }
public override double gaugeMultiplier { get { return bmson.info.total / 100.0; } }
public override double gaugeMultiplier { get { return total / 100.0; } }
public override double volume { get { return 1.0; } }
public override int playLevel { get { return (int)bmson.info.level; } }
public override string previewFile { get { return bmson.info.preview_music; } }
Expand All @@ -33,6 +33,7 @@ public class BMSONChart : Chart
private BMSONHeader bmson;

private int rankLegacy = 2;
private double total = 100;
private double rankMultiplierReal = 1.0;

public BMSONChart(string basePath, BMSONHeader bmson)
Expand Down Expand Up @@ -60,6 +61,13 @@ public override void GenerateEvents()
else
rankMultiplierReal = bmson.info.judge_rank / 100.0;

total = bmson.info.total;

// total value should be in percentages, but the value was entered
// as a multiplier, convert the value back to percentages.
if (total <= 13) // arbitrary value
total = bmson.info.total * 100.0;

// collect all time related events into one collection
if (version.Major == 0) // bmson 0.21
{
Expand Down

0 comments on commit c44ebe2

Please sign in to comment.