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:
Misa
2020-04-06 23:46:27 -07:00
committed by Ethan Lee
parent 94b2ebd55c
commit 9510c3c871
6 changed files with 43 additions and 58 deletions

View File

@@ -2117,7 +2117,7 @@ void mapinput()
game.savetime = game.timestring();
game.savearea = map.currentarea(map.area(game.roomx, game.roomy));
game.savetrinkets = game.trinkets;
game.savetrinkets = game.trinkets();
if (game.roomx >= 102 && game.roomx <= 104 && game.roomy >= 110 && game.roomy <= 111) game.savearea = "The Ship";