mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
Adapt the unit tests to the new list rules, change some casts to
new method for testing
This commit is contained in:
@@ -5614,12 +5614,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (remain < 6)
|
||||
return;
|
||||
|
||||
face = Convert.ToInt32(rules.Data[idx++].ToString()); // holeshape
|
||||
v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // cut
|
||||
hollow = (float)Convert.ToDouble(rules.Data[idx++].ToString());
|
||||
twist = new LSL_Types.Vector3(rules.Data[idx++].ToString());
|
||||
taper_b = new LSL_Types.Vector3(rules.Data[idx++].ToString());
|
||||
topshear = new LSL_Types.Vector3(rules.Data[idx++].ToString());
|
||||
face = (int)rules.GetLSLIntegerItem(idx++);
|
||||
v = rules.GetVector3Item(idx++); // cut
|
||||
hollow = (float)rules.GetLSLFloatItem(idx++);
|
||||
twist = rules.GetVector3Item(idx++);
|
||||
taper_b = rules.GetVector3Item(idx++);
|
||||
topshear = rules.GetVector3Item(idx++);
|
||||
|
||||
part.Shape.PathCurve = (byte)Extrusion.Straight;
|
||||
SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear, 1);
|
||||
break;
|
||||
|
||||
@@ -454,7 +454,12 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
|
||||
public LSL_Types.LSLInteger GetLSLIntegerItem(int itemIndex)
|
||||
{
|
||||
return (LSL_Types.LSLInteger)m_data[itemIndex];
|
||||
if (m_data[itemIndex] is LSL_Types.LSLInteger)
|
||||
return (LSL_Types.LSLInteger)m_data[itemIndex];
|
||||
else if (m_data[itemIndex] is Int32)
|
||||
return new LSLInteger((int)m_data[itemIndex]);
|
||||
else
|
||||
throw new InvalidCastException();
|
||||
}
|
||||
|
||||
public LSL_Types.Vector3 GetVector3Item(int itemIndex)
|
||||
|
||||
Reference in New Issue
Block a user