Pārlūkot izejas kodu

Update math_ScriptBinding.cc

Prevents a weird bug where mRound(-0.49) returns a negative zero.
Peter Robinson 9 mēneši atpakaļ
vecāks
revīzija
6e939aa87d
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  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
     @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.
 /*! Use the mCeil function to calculate the next highest integer value from val.