diff options
| author | MegaMech <MegaMech@users.noreply.github.com> | 2024-10-05 15:31:31 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-05 15:31:31 -0600 |
| commit | 75297759ee906b103ff9714dad17e683f1757b7f (patch) | |
| tree | 2a81aff6c8e1d2be2806f34f8850c74499980479 /src/save.c | |
| parent | 447fd8b29057e8dcc223507e6b7d6bc448c6f7d8 (diff) | |
[modding] Course Mod Support (#104)
* Course Manager
* Course
* Test
* Render
* That escalated quickly
* update
* properties
* Properties
* test
* Fix compile
* Add World
* skycolours
* Skybox Colours done
* Cleanup
* test
* Game runs again
* update
* Game run again
* Cup Works
* continue
* Add Courses
* clouds
* changes
* fixes
* update
* Fix compile
* update
* A few changes
* More Updates
* More refactors
* Fixes
* Fix ai behaviour
* Changes
* Fix courses
* test course test not working
* CUSTOM
* TestCourse works kinda
* fixes
* test course works
* cleanup
---------
Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com>
Diffstat (limited to 'src/save.c')
| -rw-r--r-- | src/save.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/save.c b/src/save.c index fb52a9e9f..e6d773d21 100644 --- a/src/save.c +++ b/src/save.c @@ -246,8 +246,8 @@ u32 func_800B4DF4(u8* arr) { // Get a time trial record, infer course index s32 func_800B4E24(s32 recordIndex) { - return func_800B4DF4(gSaveData.allCourseTimeTrialRecords.cupRecords[(((gCupSelection * 4) + gCourseIndexInCup) / 4)] - .courseRecords[(((gCupSelection * 4) + gCourseIndexInCup) % 4)] + return func_800B4DF4(gSaveData.allCourseTimeTrialRecords.cupRecords[(((GetCupIndex() * 4) + gCourseIndexInCup) / 4)] + .courseRecords[(((GetCupIndex() * 4) + gCourseIndexInCup) % 4)] .records[recordIndex]); } @@ -260,8 +260,8 @@ u32 func_800B4EB4(s32 recordIndex, s32 courseIndex) { // Get Best Lap record of the inferred course index s32 func_800B4F2C(void) { - return func_800B4DF4(gSaveData.allCourseTimeTrialRecords.cupRecords[(((gCupSelection * 4) + gCourseIndexInCup) / 4)] - .courseRecords[(((gCupSelection * 4) + gCourseIndexInCup) % 4)] + return func_800B4DF4(gSaveData.allCourseTimeTrialRecords.cupRecords[(((GetCupIndex() * 4) + gCourseIndexInCup) / 4)] + .courseRecords[(((GetCupIndex() * 4) + gCourseIndexInCup) % 4)] .records[TIME_TRIAL_1LAP_RECORD]); } @@ -279,7 +279,7 @@ s32 func_800B5020(u32 time, s32 charId) { s32 j; CourseTimeTrialRecords* tt; - course = gCupSelection * 4 + gCourseIndexInCup; + course = GetCupIndex() * 4 + gCourseIndexInCup; tt = &gSaveData.allCourseTimeTrialRecords.cupRecords[course / 4].courseRecords[course % 4]; i = 0; @@ -326,7 +326,7 @@ s32 func_800B5218(void) { s32 checkLapIndex; s32 character; s32 lapBitmask; - recordIndex = (gCupSelection * 4) + gCourseIndexInCup; + recordIndex = (GetCupIndex() * 4) + gCourseIndexInCup; recordPointer = &gSaveData.allCourseTimeTrialRecords.cupRecords[recordIndex / 4].courseRecords[recordIndex % 4].records[0][0]; lapBitmask = 1; @@ -363,10 +363,10 @@ void func_800B536C(s32 arg0) { if (arg0 >= 0) { points = &gSaveData.main.saveInfo.grandPrixPoints[gCCSelection]; - tmp = func_800B54EC(gCupSelection, *points); + tmp = func_800B54EC(GetCupIndex(), *points); tmp2 = 3 - arg0; if ((arg0 < 3) && (tmp < (3 - arg0))) { - *points = func_800B5508(gCupSelection, *points, tmp2); + *points = func_800B5508(GetCupIndex(), *points, tmp2); write_save_data_grand_prix_points_and_sound_mode(); update_save_data_backup(); } @@ -432,12 +432,12 @@ s32 func_800B5530(s32 cc_mode) { } // Check if the 150CC mode has all 4 gold cups -s32 func_800B555C(void) { +s32 has_unlocked_extra_mode(void) { return func_800B5530(CC_150); } // Check if the Extra mode has all 4 gold cups -s32 func_800B557C(void) { +s32 has_completed_extra_mode(void) { return func_800B5530(CC_EXTRA); } @@ -785,7 +785,7 @@ s32 func_800B6178(s32 arg0) { if (var_v0 == 0) { temp_s3->ghostDataSaved = 1; if (gGamestate == 4) { - temp_s3->courseIndex = (gCupSelection * 4) + gCourseIndexInCup; + temp_s3->courseIndex = (GetCupIndex() * 4) + gCourseIndexInCup; } temp_s3->unk_00 = D_80162DFC; temp_s3->characterId = (u8) D_80162DE0; @@ -834,7 +834,7 @@ s32 func_800B63F0(s32 arg0) { func_80005AE8(gPlayerThree); phi_s3 = 0; - if (((gCupSelection * 4) + gCourseIndexInCup) != D_8018EE10[arg0].courseIndex) { + if (((GetCupIndex() * 4) + gCourseIndexInCup) != D_8018EE10[arg0].courseIndex) { phi_s3 = 2; } else if (D_80162DFC != D_8018EE10[arg0].unk_00) { phi_s3 = 3; |
