LSL fix a vector lslvector cast

This commit is contained in:
UbitUmarov
2022-10-30 20:47:09 +00:00
parent 3a628c335e
commit 61527e82ff
2 changed files with 6 additions and 8 deletions

View File

@@ -14815,21 +14815,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
break;
case ScriptBaseClass.OBJECT_VELOCITY:
Vector3 vel = Vector3.Zero;
Vector3 vel;
if (obj.ParentGroup.IsAttachment)
{
ScenePresence sp = World.GetScenePresence(obj.ParentGroup.AttachedAvatar);
if (sp != null)
vel = sp.GetWorldVelocity();
vel = sp != null ? sp.GetWorldVelocity() : Vector3.Zero;
}
else
{
vel = obj.Velocity;
}
ret.Add(vel);
ret.Add(new LSL_Vector(vel));
break;
case ScriptBaseClass.OBJECT_OWNER:
ret.Add(new LSL_String(obj.OwnerID.ToString()));

View File

@@ -59,9 +59,9 @@ namespace OpenSim.Region.ScriptEngine.Shared
public Vector3(Vector3 vector)
{
x = (float)vector.x;
y = (float)vector.y;
z = (float)vector.z;
x = vector.x;
y = vector.y;
z = vector.z;
}
public Vector3(OMV_Vector3 vector)