hack to work around rounding error

This commit is contained in:
Glenn Maynard
2005-02-25 01:46:10 +00:00
parent ffd47bbf29
commit 9faf6be1bd
+6 -1
View File
@@ -246,7 +246,12 @@ void UnlockManager::Load()
if( cmd.GetName() == "song" )
current.m_sSongName = cmd.GetArg(1);
else if( cmd.GetName() == "code" )
current.m_iCode = cmd.GetArg(1);
{
// Hack: Lua only has a floating point type, and codes may be big enough
// that converting them from string to float to int introduces rounding
// error. Convert directly to int.
current.m_iCode = atoi( (CString) cmd.GetArg(1) );
}
else if( cmd.GetName() == "roulette" )
bRoulette = true;
else