瀏覽代碼

Update math_ScriptBinding.cc

Prevents a weird bug where mRound(-0.49) returns a negative zero.
Peter Robinson 9 月之前
父節點
當前提交
6e939aa87d
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      engine/source/math/math_ScriptBinding.cc

+ 2 - 2
engine/source/math/math_ScriptBinding.cc

@@ -92,9 +92,9 @@ ConsoleFunctionWithDocs( mFloor, ConsoleInt, 2, 2, ( val ))
     @return Returns the integer value closest to the given float
 
 */
-ConsoleFunctionWithDocs( mRound, ConsoleFloat, 2, 2, (float v))
+ConsoleFunctionWithDocs( mRound, ConsoleInt, 2, 2, (float v))
 {
-   return mRound( dAtof(argv[1]) );
+   return (S32)mRound( dAtof(argv[1]) );
 }
 
 /*! Use the mCeil function to calculate the next highest integer value from val.