Fix minor race condition in llGetCameraPos() where an inconsistent post could be returned for a moving camera

0.7.4-extended
Justin Clark-Casey (justincc) 2013-03-14 22:46:27 +00:00
parent eb29597c6e
commit ac063b4681
1 changed files with 5 additions and 4 deletions

View File

@ -9790,21 +9790,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1);
if (m_item.PermsGranter == UUID.Zero)
return new LSL_Vector();
return Vector3.Zero;
if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0)
{
ShoutError("No permissions to track the camera");
return new LSL_Vector();
return Vector3.Zero;
}
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
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 new LSL_Vector();
return Vector3.Zero;
}
public LSL_Rotation llGetCameraRot()