1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-28 15:38:30 +02:00

Make obj.customcollect a vector of bools

It's already treated as a vector of bools, so might as well formally
declare it as that.
This commit is contained in:
Misa 2020-04-08 23:58:03 -07:00 committed by Ethan Lee
parent 8507bdc65d
commit 17a64aee7a
4 changed files with 9 additions and 9 deletions

View File

@ -1958,7 +1958,7 @@ void entityclass::createentity( float xp, float yp, int t, float vx /*= 0*/, flo
//Check if it's already been collected //Check if it's already been collected
entity.para = vx; entity.para = vx;
if (customcollect[vx] == 1) return; if (customcollect[vx]) return;
break; break;
case 56: //Custom enemy case 56: //Custom enemy
entity.rule = 1; entity.rule = 1;
@ -3098,7 +3098,7 @@ void entityclass::updateentities( int i )
{ {
if (game.intimetrial) if (game.intimetrial)
{ {
customcollect[entities[i].para] = 1; customcollect[entities[i].para] = true;
music.playef(27); music.playef(27);
} }
else else
@ -3107,7 +3107,7 @@ void entityclass::updateentities( int i )
//music.haltdasmusik(); //music.haltdasmusik();
if(music.currentsong!=-1) music.silencedasmusik(); if(music.currentsong!=-1) music.silencedasmusik();
music.playef(27); music.playef(27);
customcollect[entities[i].para] = 1; customcollect[entities[i].para] = true;
} }
removeentity(i); removeentity(i);

View File

@ -186,7 +186,7 @@ public:
std::vector<blockclass> blocks; std::vector<blockclass> blocks;
std::vector<bool> flags; std::vector<bool> flags;
std::vector<bool> collect; std::vector<bool> collect;
std::vector<int> customcollect; std::vector<bool> customcollect;
bool skipblocks, skipdirblocks; bool skipblocks, skipdirblocks;

View File

@ -5264,7 +5264,7 @@ void Game::customloadquick(std::string savfile)
obj.customcollect.clear(); obj.customcollect.clear();
for(size_t i = 0; i < values.size(); i++) for(size_t i = 0; i < values.size(); i++)
{ {
obj.customcollect.push_back(atoi(values[i].c_str())); obj.customcollect.push_back((bool) atoi(values[i].c_str()));
} }
} }
} }
@ -6065,7 +6065,7 @@ void Game::customsavequick(std::string savfile)
std::string customcollect; std::string customcollect;
for(size_t i = 0; i < obj.customcollect.size(); i++ ) for(size_t i = 0; i < obj.customcollect.size(); i++ )
{ {
customcollect += help.String(obj.customcollect[i]) + ","; customcollect += help.String((int) obj.customcollect[i]) + ",";
} }
msg = new TiXmlElement( "customcollect" ); msg = new TiXmlElement( "customcollect" );
msg->LinkEndChild( new TiXmlText( customcollect.c_str() )); msg->LinkEndChild( new TiXmlText( customcollect.c_str() ));
@ -7638,5 +7638,5 @@ int Game::trinkets()
int Game::crewmates() int Game::crewmates()
{ {
return std::count(obj.customcollect.begin(), obj.customcollect.end(), 1); return std::count(obj.customcollect.begin(), obj.customcollect.end(), true);
} }

View File

@ -1469,7 +1469,7 @@ void scriptclass::run()
for (i = 0; i < 100; i++) for (i = 0; i < 100; i++)
{ {
obj.collect[i] = false; obj.collect[i] = false;
obj.customcollect[i] = 0; obj.customcollect[i] = false;
} }
game.deathcounts = 0; game.deathcounts = 0;
game.advancetext = false; game.advancetext = false;
@ -3561,7 +3561,7 @@ void scriptclass::hardreset()
for (i = 0; i < 100; i++) for (i = 0; i < 100; i++)
{ {
obj.collect[i] = false; obj.collect[i] = false;
obj.customcollect[i] = 0; obj.customcollect[i] = false;
} }
if (obj.getplayer() > -1){ if (obj.getplayer() > -1){