implicit operators mean one does not need to instantiate new objects manually

This commit is contained in:
SignpostMarv
2012-08-18 15:04:07 +01:00
committed by Melanie
parent 52d7af05bc
commit fb84ff96a9
2 changed files with 5 additions and 7 deletions

View File

@@ -333,8 +333,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
if (type == typeof(OpenMetaverse.Quaternion))
{
LSL_Rotation rot = (LSL_Rotation)lslparm;
return new OpenMetaverse.Quaternion((float)rot.x,(float)rot.y,(float)rot.z,(float)rot.s);
return (OpenMetaverse.Quaternion)((LSL_Rotation)lslparm);
}
}
@@ -366,8 +365,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
result[i] = new UUID((LSL_Key)plist[i]);
else if (plist[i] is LSL_Rotation)
{
LSL_Rotation rot = (LSL_Rotation)plist[i];
result[i] = new OpenMetaverse.Quaternion((float)rot.x,(float)rot.y,(float)rot.z,(float)rot.s);
result[i] = (OpenMetaverse.Quaternion)(
(LSL_Rotation)plist[i]);
}
else if (plist[i] is LSL_Vector)
{