@@ -73,12 +73,17 @@ void DECOMP_AA_EndEvent_DrawMenu(void)
7373 // if not in Token mode, these won't be used until later;
7474 lerpStartY = 0 ;
7575 lerpEndY = 0 ;
76+
77+ // For trophy race, check 1st place
78+ int boolWin = (driver -> driverRank == 0 );
7679
77- // If you're in Adventure Mode
78- if ((gGT -> gameMode1 & ADVENTURE_MODE ) != 0 )
80+ // If C-T-R token race
81+ if ((gGT -> gameMode2 & TOKEN_RACE ) != 0 )
7982 {
80- // If you won the race, and you have all 3 letters (C, T, and R)
81- if ((driver -> driverRank == 0 ) && (driver -> PickupLetterHUD .numCollected == 3 ))
83+ // add requirement of C-T-R letters
84+ boolWin = (boolWin ) && (driver -> PickupLetterHUD .numCollected == 3 );
85+
86+ if (boolWin )
8287 {
8388 // lerp C-T-R letters closer to center by 16 pixels
8489 // default (unlocking and frames < 140) or (already unlocked and frames < 300)
@@ -401,43 +406,38 @@ void DECOMP_AA_EndEvent_DrawMenu(void)
401406 // If you have not pressed X
402407 if ((sdata -> AnyPlayerTap & 0x50 ) == 0 )
403408 return ;
404-
405- // clear gamepad input
409+
410+ // === If Pressed X ===
411+
406412 RECTMENU_ClearInput ();
413+
414+ sdata -> Loading .OnBegin .AddBitsConfig0 |= ADVENTURE_ARENA ;
415+ sdata -> Loading .OnBegin .RemBitsConfig0 |= (ADVENTURE_BOSS | TOKEN_RACE );
407416
408- // if event was not won
409- if (driver -> driverRank > 0 )
417+ // If you are in boss mode
418+ if (gGT -> gameMode1 < 0 )
410419 {
411- // pass pointer to menu buffer that shows Retry / Exit To Map,
412- // identical to buffer in 221 dll, except this one in EXE space
413- RECTMENU_Show (& data .menuRetryExit );
420+ sdata -> Loading .OnBegin .AddBitsConfig8 |= SPAWN_AT_BOSS ;
421+ }
414422
415- // record that the menu is now showing
423+ if (!boolWin )
424+ {
425+ RECTMENU_Show (& data .menuRetryExit );
416426 sdata -> menuReadyToPass |= 1 ;
417427 return ;
418428 }
419429
420- // If you won the race
421- // If you have pressed X to continue...
430+ // === If you won the race ===
422431
423432 sdata -> framesSinceRaceEnded = 0 ;
424433 sdata -> numIconsEOR = 1 ;
425434
426- // when loading is done, add flag for "In Adventure Arena"
427- sdata -> Loading .OnBegin .AddBitsConfig0 |= ADVENTURE_ARENA ;
428-
429435 // Load the levelID for Adventure Hub that you came from
430436 levSpawn = gGT -> prevLEV ;
431437
432438 // If you are in boss mode
433439 if (gGT -> gameMode1 < 0 )
434440 {
435- // when loading is done, add flag for "spawn near boss door"
436- sdata -> Loading .OnBegin .AddBitsConfig8 |= SPAWN_AT_BOSS ;
437-
438- // when loading is done, remove flag for Boss Mode
439- sdata -> Loading .OnBegin .RemBitsConfig0 |= ADVENTURE_BOSS ;
440-
441441 // bitIndex of keys unlocked, and boss beaten
442442 bitIndex = gGT -> bossID + 0x5e ;
443443
@@ -478,18 +478,6 @@ void DECOMP_AA_EndEvent_DrawMenu(void)
478478 }
479479 }
480480 }
481- // if you are in token race
482- else if ((gGT -> gameMode2 & 0x8 ) != 0 )
483- {
484- // If you have collected 3 letters (C, T, and R)
485- if (driver -> PickupLetterHUD .numCollected == 3 )
486- {
487- // set bit to tokens
488- bitIndex = gGT -> levelID + 0x4c ;
489- // when loading is done, remove flag for CTR Challenge
490- sdata -> Loading .OnBegin .RemBitsConfig8 |= TOKEN_RACE ;
491- }
492- }
493481
494482 // if something needs unlocking
495483 if (bitIndex > 0 )
0 commit comments