mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 01:48:15 +03:00
Don't use separate variable for number of collected trinkets
game.trinkets is supposed to be correlated with obj.collect, however why not just count obj.collect directly? This turns game.trinkets into a function, game.trinkets(), which will directly count the number of collected trinkets and return it. This will fix a few corner cases where the number of trinkets can desync with the actual collection statuses of trinkets. In order to keep save compatibility with previous versions of VVVVVV, the game will still write the <trinkets> variable. However, it will not read the <trinkets> variable from a save file.
This commit is contained in:
@@ -2509,7 +2509,6 @@ void entityclass::updateentities( int i )
|
||||
//wait for collision
|
||||
if (entities[i].state == 1)
|
||||
{
|
||||
game.trinkets++;
|
||||
if (game.intimetrial)
|
||||
{
|
||||
collect[entities[i].para] = 1;
|
||||
@@ -2521,9 +2520,9 @@ void entityclass::updateentities( int i )
|
||||
if(music.currentsong!=-1) music.silencedasmusik();
|
||||
music.playef(3);
|
||||
collect[entities[i].para] = 1;
|
||||
if (game.trinkets > game.stat_trinkets && !map.custommode)
|
||||
if (game.trinkets() > game.stat_trinkets && !map.custommode)
|
||||
{
|
||||
game.stat_trinkets = game.trinkets;
|
||||
game.stat_trinkets = game.trinkets();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user