mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Don't use separate variable for number of trinkets in level
Same principle as removing the separate variable to track number of collected trinkets. This means it's less error-prone as we're no longer tracking number of trinkets separately. In the function that counts the number of trinkets, I would've liked to have used std::count_if(). However, the most optimal way would require using a lambda, and lambdas are too new for the C++ standard we're using. So I just bit the bullet and counted them manually.
This commit is contained in:
@@ -1950,7 +1950,7 @@ void Game::updatestate()
|
||||
#if !defined(NO_CUSTOM_LEVELS)
|
||||
if(map.custommode)
|
||||
{
|
||||
graphics.createtextbox(" " + help.number(trinkets()) + " out of " + help.number(ed.numtrinkets)+ " ", 50, 65, 174, 174, 174);
|
||||
graphics.createtextbox(" " + help.number(trinkets()) + " out of " + help.number(ed.numtrinkets())+ " ", 50, 65, 174, 174, 174);
|
||||
graphics.textboxcenterx();
|
||||
}
|
||||
else
|
||||
@@ -1970,7 +1970,7 @@ void Game::updatestate()
|
||||
#if !defined(NO_CUSTOM_LEVELS)
|
||||
if(map.custommode)
|
||||
{
|
||||
graphics.createtextbox(" " + help.number(trinkets()) + " out of " + help.number(ed.numtrinkets)+ " ", 50, 135, 174, 174, 174);
|
||||
graphics.createtextbox(" " + help.number(trinkets()) + " out of " + help.number(ed.numtrinkets())+ " ", 50, 135, 174, 174, 174);
|
||||
graphics.textboxcenterx();
|
||||
}
|
||||
else
|
||||
@@ -2095,7 +2095,7 @@ void Game::updatestate()
|
||||
if(ed.numcrewmates-crewmates()==0)
|
||||
{
|
||||
//Finished level
|
||||
if(ed.numtrinkets-trinkets()==0)
|
||||
if(ed.numtrinkets()-trinkets()==0)
|
||||
{
|
||||
//and got all the trinkets!
|
||||
updatecustomlevelstats(customlevelfilename, 3);
|
||||
|
||||
Reference in New Issue
Block a user