Removed gChangeAreaIndex as it is unused (and does nothing), and fixed thi and crashes (#187)

* Removed gChangeAreaIndex as it is unused, and fixed thi and crashes

* Fixes

* undo formatting

* Undid stones
This commit is contained in:
Emerald Lockdown 2022-09-18 19:28:09 -05:00 committed by GitHub
parent 538383235f
commit 7b3b174f11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View file

@ -60,7 +60,6 @@ u8 gRejectInstantWarp = 0;
s16 gChangeLevel = -1;
s16 gChangeLevelTransition = -1;
s16 gChangeAreaIndex = -1;
s16 gChangeActNum = -1;
static bool sFirstCastleGroundsMenu = true;
@ -1338,15 +1337,19 @@ void update_menu_level(void) {
gChangeLevel = curLevel;
gChangeActNum = 2;
} else if (curLevel == LEVEL_THI) {
gChangeLevel = curLevel;
gChangeAreaIndex = 2;
gChangeActNum = 6;
gChangeLevel = LEVEL_THI;
} else {
gChangeLevel = curLevel;
gChangeActNum = 6;
}
}
if (gCurrAreaIndex != 2 && gCurrLevelNum == LEVEL_THI) {
sWarpDest.type = WARP_TYPE_CHANGE_AREA;
sWarpDest.areaIdx = 2;
sWarpDest.nodeId = 0x0A;
}
// set sFirstCastleGroundsMenu to false to prevent wall hugging bug
if (curLevel != LEVEL_CASTLE_GROUNDS) {
sFirstCastleGroundsMenu = false;
@ -1455,7 +1458,6 @@ void update_menu_level(void) {
gChangeActNum = 2;
} else if (curLevel == LEVEL_THI) {
gChangeLevel = curLevel;
gChangeAreaIndex = 2;
gChangeActNum = 6;
} else {
gChangeLevel = curLevel;

View file

@ -78,7 +78,6 @@ extern void (*sTransitionUpdate)(s16 *);
extern u8 unused3[4];
extern s16 gChangeLevel;
extern s16 gChangeAreaIndex;
extern s16 gChangeActNum;
struct WarpDest {