Merge pull request #1071 from PokeCF/patch-3

Unnest if statements
This commit is contained in:
Sierra A 2020-06-10 13:23:57 -07:00 committed by GitHub
commit a7815857ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,31 +35,31 @@ void PlayTimeCounter_Stop(void)
void PlayTimeCounter_Update(void)
{
if (sPlayTimeCounterState == RUNNING)
{
gSaveBlock2Ptr->playTimeVBlanks++;
if (sPlayTimeCounterState != RUNNING)
return;
if (gSaveBlock2Ptr->playTimeVBlanks > 59)
{
gSaveBlock2Ptr->playTimeVBlanks = 0;
gSaveBlock2Ptr->playTimeSeconds++;
gSaveBlock2Ptr->playTimeVBlanks++;
if (gSaveBlock2Ptr->playTimeSeconds > 59)
{
gSaveBlock2Ptr->playTimeSeconds = 0;
gSaveBlock2Ptr->playTimeMinutes++;
if (gSaveBlock2Ptr->playTimeVBlanks < 60)
return;
if (gSaveBlock2Ptr->playTimeMinutes > 59)
{
gSaveBlock2Ptr->playTimeMinutes = 0;
gSaveBlock2Ptr->playTimeHours++;
gSaveBlock2Ptr->playTimeVBlanks = 0;
gSaveBlock2Ptr->playTimeSeconds++;
if (gSaveBlock2Ptr->playTimeHours > 999)
PlayTimeCounter_SetToMax();
}
}
}
}
if (gSaveBlock2Ptr->playTimeSeconds < 60)
return;
gSaveBlock2Ptr->playTimeSeconds = 0;
gSaveBlock2Ptr->playTimeMinutes++;
if (gSaveBlock2Ptr->playTimeMinutes < 60)
return;
gSaveBlock2Ptr->playTimeMinutes = 0;
gSaveBlock2Ptr->playTimeHours++;
if (gSaveBlock2Ptr->playTimeHours > 999)
PlayTimeCounter_SetToMax();
}
void PlayTimeCounter_SetToMax(void)