浏览代码

Update sfxSound.cpp

irei1as 7 年之前
父节点
当前提交
0419ed0475
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      Engine/source/sfx/sfxSound.cpp

+ 3 - 2
Engine/source/sfx/sfxSound.cpp

@@ -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 );
 }
 
 //-----------------------------------------------------------------------------