Fix minor race condition in llGetCameraPos() where an inconsistent post could be returned for a moving camera
parent
d4b109b4c4
commit
114fd042de
|
@ -9916,21 +9916,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
if (m_item.PermsGranter == UUID.Zero)
|
if (m_item.PermsGranter == UUID.Zero)
|
||||||
return new LSL_Vector();
|
return Vector3.Zero;
|
||||||
|
|
||||||
if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0)
|
if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0)
|
||||||
{
|
{
|
||||||
ShoutError("No permissions to track the camera");
|
ShoutError("No permissions to track the camera");
|
||||||
return new LSL_Vector();
|
return Vector3.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
|
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
|
||||||
if (presence != null)
|
if (presence != null)
|
||||||
{
|
{
|
||||||
LSL_Vector pos = new LSL_Vector(presence.CameraPosition.X, presence.CameraPosition.Y, presence.CameraPosition.Z);
|
LSL_Vector pos = new LSL_Vector(presence.CameraPosition);
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
return new LSL_Vector();
|
|
||||||
|
return Vector3.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LSL_Rotation llGetCameraRot()
|
public LSL_Rotation llGetCameraRot()
|
||||||
|
|
Loading…
Reference in New Issue