@@ -8,15 +8,7 @@ void DECOMP_LOAD_Hub_Main(int bigfilePtr)
88 if (sdata -> Loading .stage != -1 ) return ;
99
1010 gGT = sdata -> gGT ;
11-
12- #if 1
13- // not in the OG game, but for some reason decomp
14- // needs it to prevent crashing on Nitro Court,
15- // something bugs in 4P Life Limit that makes stepFlagSet
16- // try to make the advHub flip, maybe from null AI data?
17- if ((gGT -> gameMode1 & ADVENTURE_ARENA ) == 0 ) return ;
18- #endif
19-
11+
2012 int stepFlagSet = gGT -> drivers [0 ]-> stepFlagSet ;
2113 int nextLevelID = (stepFlagSet & 0x30 ) >> 4 ;
2214 int needSwapNow = (stepFlagSet & 0xc0 ) >> 6 ;
@@ -37,12 +29,14 @@ void DECOMP_LOAD_Hub_Main(int bigfilePtr)
3729 // if new level needs to load
3830 else
3931 {
40- // skip levelID check, it'll never happen
41- // without being on the adv hub anyway
32+ // only in AdvHub, or else the game
33+ // crashes in 4P Nitro Court Life Limit
34+ unsigned int currLevelID = gGT -> levelID - 0x19 ;
35+ if (currLevelID >= 5 ) return ;
4236
4337 LOAD_Hub_ReadFile (
4438 bigfilePtr ,
45- rdata .MetaDataHubs [gGT -> levelID - 0x19 ].connectedHub_LevID [nextLevelID - 1 ],
39+ rdata .MetaDataHubs [currLevelID ].connectedHub_LevID [nextLevelID - 1 ],
4640 3 - gGT -> activeMempackIndex
4741 );
4842 }
0 commit comments