From 6e939aa87d59d9a250b7dc3b9d3250e9f6886d6d Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sat, 21 Dec 2024 08:18:28 -0500 Subject: [PATCH] Update math_ScriptBinding.cc Prevents a weird bug where mRound(-0.49) returns a negative zero. --- engine/source/math/math_ScriptBinding.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/source/math/math_ScriptBinding.cc b/engine/source/math/math_ScriptBinding.cc index 159a92375..9dd72a248 100644 --- a/engine/source/math/math_ScriptBinding.cc +++ b/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.