replace gotos with if blocks where appropriate
This commit is contained in:
@@ -457,12 +457,10 @@ class OptionRowHandlerListSteps : public OptionRowHandlerList
|
|||||||
if (STEPS_USE_CHART_NAME)
|
if (STEPS_USE_CHART_NAME)
|
||||||
{
|
{
|
||||||
s = pSteps->GetChartName();
|
s = pSteps->GetChartName();
|
||||||
|
}
|
||||||
// TODO: find a way to make this use lua or metrics.
|
// TODO: find a way to make this use lua or metrics.
|
||||||
if (!(s == "" || s == "blank" || s == "Blank"))
|
if (s == "" || s == "blank" || s == "Blank")
|
||||||
{
|
{
|
||||||
goto nameGotten;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if( pSteps->GetDifficulty() == Difficulty_Edit )
|
if( pSteps->GetDifficulty() == Difficulty_Edit )
|
||||||
{
|
{
|
||||||
s = pSteps->GetChartName();
|
s = pSteps->GetChartName();
|
||||||
@@ -480,7 +478,7 @@ class OptionRowHandlerListSteps : public OptionRowHandlerList
|
|||||||
else
|
else
|
||||||
s = CustomDifficultyToLocalizedString( GetCustomDifficulty( pSteps->m_StepsType, pSteps->GetDifficulty(), CourseType_Invalid ) );
|
s = CustomDifficultyToLocalizedString( GetCustomDifficulty( pSteps->m_StepsType, pSteps->GetDifficulty(), CourseType_Invalid ) );
|
||||||
}
|
}
|
||||||
nameGotten:
|
}
|
||||||
s += ssprintf( " %d", pSteps->GetMeter() );
|
s += ssprintf( " %d", pSteps->GetMeter() );
|
||||||
m_Def.m_vsChoices.push_back( s );
|
m_Def.m_vsChoices.push_back( s );
|
||||||
GameCommand mc;
|
GameCommand mc;
|
||||||
|
|||||||
+8
-9
@@ -869,16 +869,13 @@ void Song::ReCalculateRadarValuesAndLastSecond(bool fromCache, bool duringCache)
|
|||||||
|
|
||||||
// calculate lastSecond
|
// calculate lastSecond
|
||||||
|
|
||||||
// If it's autogen, then first/last beat will come from the parent.
|
/* 1. If it's autogen, then first/last beat will come from the parent.
|
||||||
if( pSteps->IsAutogen() )
|
* 2. Don't calculate with edits unless the song only contains an edit
|
||||||
goto wipe_notedata;
|
|
||||||
|
|
||||||
/* Don't calculate with edits unless the song only contains an edit
|
|
||||||
* chart, like those in Mungyodance 3. Otherwise, edits installed on
|
* chart, like those in Mungyodance 3. Otherwise, edits installed on
|
||||||
* the machine could extend the length of the song. */
|
* the machine could extend the length of the song. */
|
||||||
if( pSteps->IsAnEdit() && m_vpSteps.size() > 1 )
|
if( !pSteps->IsAutogen() &&
|
||||||
goto wipe_notedata;
|
!( pSteps->IsAnEdit() && m_vpSteps.size() > 1 ) )
|
||||||
|
{
|
||||||
// Don't set first/last beat based on lights. They often start very
|
// Don't set first/last beat based on lights. They often start very
|
||||||
// early and end very late.
|
// early and end very late.
|
||||||
if( pSteps->m_StepsType == StepsType_lights_cabinet )
|
if( pSteps->m_StepsType == StepsType_lights_cabinet )
|
||||||
@@ -893,7 +890,9 @@ void Song::ReCalculateRadarValuesAndLastSecond(bool fromCache, bool duringCache)
|
|||||||
localLast = max(localLast,
|
localLast = max(localLast,
|
||||||
pSteps->GetTimingData()->GetElapsedTimeFromBeat(tempNoteData.GetLastBeat()));
|
pSteps->GetTimingData()->GetElapsedTimeFromBeat(tempNoteData.GetLastBeat()));
|
||||||
}
|
}
|
||||||
wipe_notedata:
|
}
|
||||||
|
|
||||||
|
// Wipe NoteData
|
||||||
if (duringCache)
|
if (duringCache)
|
||||||
{
|
{
|
||||||
NoteData dummy;
|
NoteData dummy;
|
||||||
|
|||||||
Reference in New Issue
Block a user