Fix std::stoi bad behaviour closes #2130
Patched with outfox upstream, this restores BG as it is expected
This commit is contained in:
@@ -976,7 +976,7 @@ bool SMLoader::LoadFromBGChangesVector( BackgroundChange &change, std::vector<RS
|
|||||||
// Backward compatibility:
|
// Backward compatibility:
|
||||||
if( change.m_def.m_sEffect.empty() )
|
if( change.m_def.m_sEffect.empty() )
|
||||||
{
|
{
|
||||||
bool bLoop = std::stoi( aBGChangeValues[5] ) != 0;
|
bool bLoop = StringToInt( aBGChangeValues[5] ) != 0;
|
||||||
if( !bLoop )
|
if( !bLoop )
|
||||||
change.m_def.m_sEffect = SBE_StretchNoLoop;
|
change.m_def.m_sEffect = SBE_StretchNoLoop;
|
||||||
}
|
}
|
||||||
@@ -986,7 +986,7 @@ bool SMLoader::LoadFromBGChangesVector( BackgroundChange &change, std::vector<RS
|
|||||||
// Backward compatibility:
|
// Backward compatibility:
|
||||||
if( change.m_def.m_sEffect.empty() )
|
if( change.m_def.m_sEffect.empty() )
|
||||||
{
|
{
|
||||||
bool bRewindMovie = std::stoi( aBGChangeValues[4] ) != 0;
|
bool bRewindMovie = StringToInt( aBGChangeValues[4] ) != 0;
|
||||||
if( bRewindMovie )
|
if( bRewindMovie )
|
||||||
change.m_def.m_sEffect = SBE_StretchRewind;
|
change.m_def.m_sEffect = SBE_StretchRewind;
|
||||||
}
|
}
|
||||||
@@ -995,7 +995,7 @@ bool SMLoader::LoadFromBGChangesVector( BackgroundChange &change, std::vector<RS
|
|||||||
// param 9 overrides this.
|
// param 9 overrides this.
|
||||||
// Backward compatibility:
|
// Backward compatibility:
|
||||||
if( change.m_sTransition.empty() )
|
if( change.m_sTransition.empty() )
|
||||||
change.m_sTransition = (std::stoi( aBGChangeValues[3] ) != 0) ? "CrossFade" : "";
|
change.m_sTransition = (StringToInt( aBGChangeValues[3] ) != 0) ? "CrossFade" : "";
|
||||||
// fall through
|
// fall through
|
||||||
case 3:
|
case 3:
|
||||||
change.m_fRate = StringToFloat( aBGChangeValues[2] );
|
change.m_fRate = StringToFloat( aBGChangeValues[2] );
|
||||||
|
|||||||
Reference in New Issue
Block a user