mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-09 10:29:45 +01:00
Don't savestats() every frame of New Record animation
Otherwise, this would cause immense slowdown during the New Record animation that plays when you die, as the game would be writing unlock.vvv every frame. To fix this, I just put it under the same if-guard as the music.playef(), since the sound effect also only plays once. But I have to watch out for frame ordering and make sure the record is actually set before I call game.savestats(), and then of course I have to move game.swnmessage = 1 over because that's the variable being checked in the conditional.
This commit is contained in:
parent
18b7d1ca14
commit
6c04f56099
1 changed files with 6 additions and 3 deletions
|
@ -556,11 +556,14 @@ void gamelogic()
|
|||
game.swndelay = 0;
|
||||
if (game.swntimer >= game.swnrecord)
|
||||
{
|
||||
if (game.swnmessage == 0) music.playef(25);
|
||||
game.swnmessage = 1;
|
||||
game.swnrecord = game.swntimer;
|
||||
if (game.swnmessage == 0)
|
||||
{
|
||||
music.playef(25);
|
||||
game.savestats();
|
||||
}
|
||||
game.swnmessage = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue