Update sfxSound.cpp

This commit is contained in:
irei1as 2018-03-11 17:20:59 +01:00 committed by GitHub
parent cfb88b27e7
commit 0380b95492
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -693,8 +693,9 @@ DefineEngineMethod( SFXSound, setPosition, void, ( F32 position ),,
"playback will resume at the given position when play() is called.\n\n"
"@param position The new position of the play cursor (in seconds).\n" )
{
if( position >= 0 && position <= object->getDuration() )
object->setPosition( position * 1000.0f );
position *= 1000.0f;
if( position >= 0 && position < object->getDuration() )
object->setPosition( position );
}
//-----------------------------------------------------------------------------