mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Remove i/j/k attributes from classes that don't need them
The only class that actually needs its i/j/k kept is scriptclass, because some custom levels rely on it for creating custom activity zones. So I haven't touched that. Other than that, there's no chance that anything important relies on i/j/k in any other class. For that to be the case, it would have to use i/j/k without initializing it beforehand, and that can simply be detected by removing the attribute from the header file and seeing where the compiler complains. And the compiler complains only about cases where it's initialized first. (Note that due to this check, I *haven't* removed Graphics's `m` as it precisely does exactly this, using it without initializing it first.) Interestingly enough, otherlevelclass and towerclass have unused i/k variables for whatever reason.
This commit is contained in:
@@ -1047,7 +1047,7 @@ void mapclass::gotoroom(int rx, int ry)
|
||||
if (obj.entities[i].xp <= 0 || obj.entities[i].xp + obj.entities[i].w >= 312)
|
||||
{
|
||||
//it's on a screen edge
|
||||
for (j = 0; j < (int) obj.linecrosskludge.size(); j++)
|
||||
for (size_t j = 0; j < obj.linecrosskludge.size(); j++)
|
||||
{
|
||||
if (obj.entities[i].yp == obj.linecrosskludge[j].yp)
|
||||
{
|
||||
@@ -1901,7 +1901,7 @@ void mapclass::loadlevel(int rx, int ry)
|
||||
{
|
||||
//A slight varation - she's upside down
|
||||
obj.createentity(249, 62, 18, 16, 0, 18);
|
||||
j = obj.getcrewman(5);
|
||||
int j = obj.getcrewman(5);
|
||||
obj.entities[j].rule = 7;
|
||||
obj.entities[j].tile +=6;
|
||||
//What script do we use?
|
||||
@@ -1918,7 +1918,7 @@ void mapclass::loadlevel(int rx, int ry)
|
||||
if (obj.entities[i].state == 18)
|
||||
{
|
||||
//face the player
|
||||
j = obj.getplayer();
|
||||
int j = obj.getplayer();
|
||||
if (j > -1 && obj.entities[j].xp > obj.entities[i].xp + 5)
|
||||
{
|
||||
obj.entities[i].dir = 1;
|
||||
|
||||
Reference in New Issue
Block a user