mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 22:26:09 +08:00
* Applying melanie's List2Vector and List2Rot patch. Added a routine in the Quaternion constructors to catch 0,0,0,0 quaternions and convert them to 0,0,0,1 (as 0,0,0,0 is implicitly converted to 0,0,0,1 in LSL and will crash libsl if left which will in turn crash the simulator)
This commit is contained in:
@@ -2979,7 +2979,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
}
|
||||
else
|
||||
{
|
||||
return new LSL_Types.Vector3(0, 0, 0);
|
||||
return new LSL_Types.Vector3(src.Data[index].ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3000,7 +3000,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
}
|
||||
else
|
||||
{
|
||||
return new LSL_Types.Quaternion(0, 0, 0, 1);
|
||||
return new LSL_Types.Quaternion(src.Data[index].ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -259,6 +259,8 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
y = (float)Quat.y;
|
||||
z = (float)Quat.z;
|
||||
s = (float)Quat.s;
|
||||
if (x == 0 && y == 0 && z == 0 && s == 0)
|
||||
s = 1;
|
||||
}
|
||||
|
||||
public Quaternion(double X, double Y, double Z, double S)
|
||||
@@ -267,6 +269,8 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
y = Y;
|
||||
z = Z;
|
||||
s = S;
|
||||
if (x == 0 && y == 0 && z == 0 && s == 0)
|
||||
s = 1;
|
||||
}
|
||||
|
||||
public Quaternion(string str)
|
||||
@@ -279,6 +283,8 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
res = res & Double.TryParse(tmps[1], out y);
|
||||
res = res & Double.TryParse(tmps[2], out z);
|
||||
res = res & Double.TryParse(tmps[3], out s);
|
||||
if (x == 0 && y == 0 && z == 0 && s == 0)
|
||||
s = 1;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user