1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 01:59:43 +01:00

Move roomchangedir off of Game

This is a temporary variable that doesn't need to be on Game. It is
guaranteed to be initialized every time mapclass::gotoroom() gets
called, so it's safe to move it off.
This commit is contained in:
Misa 2021-04-16 23:08:27 -07:00 committed by Misa Elizabeth Kai
parent 48cddf57a6
commit 382b83a54d
2 changed files with 6 additions and 4 deletions

View file

@ -215,7 +215,7 @@ public:
int door_right; int door_right;
int door_up; int door_up;
int door_down; int door_down;
int roomx, roomy, roomchangedir; int roomx, roomy;
int prevroomx, prevroomy; int prevroomx, prevroomy;
int savex, savey, saverx, savery; int savex, savey, saverx, savery;

View file

@ -903,6 +903,8 @@ void mapclass::warpto(int rx, int ry , int t, int tx, int ty)
void mapclass::gotoroom(int rx, int ry) void mapclass::gotoroom(int rx, int ry)
{ {
int roomchangedir;
//First, destroy the current room //First, destroy the current room
obj.removeallblocks(); obj.removeallblocks();
game.activetele = false; game.activetele = false;
@ -953,11 +955,11 @@ void mapclass::gotoroom(int rx, int ry)
if (rx < game.roomx) if (rx < game.roomx)
{ {
game.roomchangedir = 0; roomchangedir = 0;
} }
else else
{ {
game.roomchangedir = 1; roomchangedir = 1;
} }
if (finalmode) if (finalmode)
@ -1073,7 +1075,7 @@ void mapclass::gotoroom(int rx, int ry)
{ {
//y's match, how about x's? //y's match, how about x's?
//we're moving left: //we're moving left:
if (game.roomchangedir == 0) if (roomchangedir == 0)
{ {
if (obj.entities[i].xp + obj.entities[i].w >= 312 && obj.linecrosskludge[j].xp <= 0) if (obj.entities[i].xp + obj.entities[i].w >= 312 && obj.linecrosskludge[j].xp <= 0)
{ {