From Rob Smart <SMARTROB@uk.ibm.com>
In SL if llAbs() is called with the minimum integer value of -2147483648 it will return that value untouched without error. this patch replicates the SL functionality. OpenSim currently throws an overflow exception: number too small under mono or a "System.OverflowException: Negating the minimum value of a twos complement number is invalid. " under .NET0.6.3-post-fixes
parent
180be7de07
commit
ac6657d0f1
|
@ -361,8 +361,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
public LSL_Integer llAbs(int i)
|
||||
{
|
||||
// changed to replicate LSL behaviour whereby minimum int value is returned untouched.
|
||||
m_host.AddScriptLPS(1);
|
||||
return (int)Math.Abs(i);
|
||||
if(i == Int32.MinValue)
|
||||
return i;
|
||||
else
|
||||
return (int)Math.Abs(i);
|
||||
}
|
||||
|
||||
public LSL_Float llFabs(double f)
|
||||
|
|
Loading…
Reference in New Issue