Fixed 100 coin star in act select

It will appear in act selection again
Sanity checked 'score' so that if the 100 coin star was collected, it will return at least 100
This commit is contained in:
MysterD 2023-11-19 16:22:22 -08:00
parent 305c6f0bca
commit f986169476
2 changed files with 12 additions and 2 deletions

View File

@ -723,7 +723,17 @@ s32 save_file_get_course_coin_score(s32 fileIndex, s32 courseIndex) {
if (INVALID_FILE_INDEX(fileIndex)) { return 0; } if (INVALID_FILE_INDEX(fileIndex)) { return 0; }
if (INVALID_SRC_SLOT(gSaveFileUsingBackupSlot)) { return 0; } if (INVALID_SRC_SLOT(gSaveFileUsingBackupSlot)) { return 0; }
if (INVALID_COURSE_COIN_INDEX(courseIndex)) { return 0; } if (INVALID_COURSE_COIN_INDEX(courseIndex)) { return 0; }
return gSaveBuffer.files[fileIndex][gSaveFileUsingBackupSlot].courseCoinScores[courseIndex]; u8 coinScore = gSaveBuffer.files[fileIndex][gSaveFileUsingBackupSlot].courseCoinScores[courseIndex];
// sanity check - if we've collected 100 coin star... we have to have had at least 100
if (coinScore < 100) {
u8 stars = save_file_get_star_flags(fileIndex, courseIndex);
if ((stars & (1 << 6))) {
coinScore = 100;
}
}
return coinScore;
} }
void save_file_set_course_coin_score(s32 fileIndex, s32 courseIndex, u8 coinScore) { void save_file_set_course_coin_score(s32 fileIndex, s32 courseIndex, u8 coinScore) {

View File

@ -97,7 +97,7 @@ void bhv_act_selector_star_type_loop(void) {
* Renders the 100 coin star with an special star selector type. * Renders the 100 coin star with an special star selector type.
*/ */
void render_100_coin_star(u8 stars) { void render_100_coin_star(u8 stars) {
if ((stars & (1 << 6)) && sStarSelectorModels[6]) { if ((stars & (1 << 6))) {
// If the 100 coin star has been collected, create a new star selector next to the coin score. // If the 100 coin star has been collected, create a new star selector next to the coin score.
sStarSelectorModels[6] = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_STAR, sStarSelectorModels[6] = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_STAR,
bhvActSelectorStarType, 370, 24, -300, 0, 0, 0); bhvActSelectorStarType, 370, 24, -300, 0, 0, 0);