nightwalk gba fix (r2) (#973)

* nw gba fix

* remove the logs

lol
This commit is contained in:
AstrlJelly 2024-06-02 17:47:34 -04:00 committed by GitHub
parent 2ae2cac02c
commit 4ce1c323ef
2 changed files with 5 additions and 13 deletions

View file

@ -559,7 +559,6 @@ namespace HeavenStudio.Games
} }
else else
{ {
allEnds.Sort((x, y) => x.beat.CompareTo(y.beat));
double nextSwitchBeat = double.MaxValue; double nextSwitchBeat = double.MaxValue;
foreach (var end in allEnds) foreach (var end in allEnds)
{ {
@ -570,19 +569,11 @@ namespace HeavenStudio.Games
break; break;
} }
} }
List<RiqEntity> tempEvents = new(); var lastCountIn = countInEvents.FindLast(e => e.beat < nextSwitchBeat && e.beat + e.length >= beat);
foreach (var countIn in countInEvents) if (lastCountIn != null)
{ {
if (countIn.beat < nextSwitchBeat) countInBeat = lastCountIn.beat;
{ countInLength = lastCountIn.length;
tempEvents.Add(countIn);
}
}
if (tempEvents.Count > 0)
{
tempEvents.Sort((x, y) => x.beat.CompareTo(y.beat));
countInBeat = tempEvents[tempEvents.Count - 1].beat;
countInLength = tempEvents[tempEvents.Count - 1].length;
} }
} }
} }

View file

@ -35,6 +35,7 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk
public void SpawnPlatforms(double beat) public void SpawnPlatforms(double beat)
{ {
Debug.Log("game.countInBeat : " + game.countInBeat);
if (game.countInBeat != double.MinValue) if (game.countInBeat != double.MinValue)
{ {
for (int i = 0; i < platformCount; i++) for (int i = 0; i < platformCount; i++)