소스 검색

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.