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 crewmates in level
Same as previous commit, this time for crewmates.
This commit is contained in:
@@ -285,7 +285,6 @@ void editorclass::reset()
|
||||
entframe=0;
|
||||
entframedelay=0;
|
||||
|
||||
numcrewmates=0;
|
||||
edentity.clear();
|
||||
levmusic=0;
|
||||
|
||||
@@ -1621,11 +1620,6 @@ int editorclass::findwarptoken(int t)
|
||||
|
||||
void editorclass::countstuff()
|
||||
{
|
||||
numcrewmates=0;
|
||||
for(size_t i=0; i<edentity.size(); i++)
|
||||
{
|
||||
if(edentity[i].t==15) numcrewmates++;
|
||||
}
|
||||
}
|
||||
|
||||
void editorclass::load(std::string& _path)
|
||||
@@ -4920,11 +4914,10 @@ void editorinput()
|
||||
}
|
||||
else if(ed.drawmode==15) //Crewmate
|
||||
{
|
||||
if(ed.numcrewmates<100)
|
||||
if(ed.numcrewmates()<100)
|
||||
{
|
||||
addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),15,1 + int(fRandom() * 5));
|
||||
ed.lclickdelay=1;
|
||||
ed.numcrewmates++;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5047,7 +5040,6 @@ void editorinput()
|
||||
{
|
||||
if(edentity[i].x==ed.tilex + (ed.levx*40)&& edentity[i].y==ed.tiley+ (ed.levy*30))
|
||||
{
|
||||
if(edentity[i].t==15) ed.numcrewmates--;
|
||||
removeedentity(i);
|
||||
}
|
||||
}
|
||||
@@ -5214,4 +5206,17 @@ int editorclass::numtrinkets()
|
||||
return temp;
|
||||
}
|
||||
|
||||
int editorclass::numcrewmates()
|
||||
{
|
||||
int temp = 0;
|
||||
for (size_t i = 0; i < edentity.size(); i++)
|
||||
{
|
||||
if (edentity[i].t == 15)
|
||||
{
|
||||
temp++;
|
||||
}
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
|
||||
#endif /* NO_CUSTOM_LEVELS */
|
||||
|
||||
Reference in New Issue
Block a user