Skip to content

Commit

Permalink
Update math_ScriptBinding.cc
Browse files Browse the repository at this point in the history
Prevents a weird bug where mRound(-0.49) returns a negative zero.
  • Loading branch information
greenfire27 committed Dec 21, 2024
1 parent 94d4b32 commit 6e939aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engine/source/math/math_ScriptBinding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 6e939aa

Please sign in to comment.