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,7 +361,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
public LSL_Integer llAbs(int i)
|
public LSL_Integer llAbs(int i)
|
||||||
{
|
{
|
||||||
|
// changed to replicate LSL behaviour whereby minimum int value is returned untouched.
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
if(i == Int32.MinValue)
|
||||||
|
return i;
|
||||||
|
else
|
||||||
return (int)Math.Abs(i);
|
return (int)Math.Abs(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue