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

user_profiles
Justin Clark-Casey (justincc) 2013-03-14 22:46:27 +00:00
parent d4b109b4c4
commit 114fd042de
1 changed files with 5 additions and 4 deletions

View File

@ -9916,21 +9916,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()