Fix minor race condition in llGetCameraRot() where inconsistent information could be returned for a rotating camera

user_profiles
Justin Clark-Casey (justincc) 2013-03-14 22:49:08 +00:00
parent 114fd042de
commit c09f4ff483
1 changed files with 4 additions and 4 deletions

View File

@ -9939,21 +9939,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1);
if (m_item.PermsGranter == UUID.Zero)
return new LSL_Rotation();
return Quaternion.Identity;
if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0)
{
ShoutError("No permissions to track the camera");
return new LSL_Rotation();
return Quaternion.Identity;
}
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
if (presence != null)
{
return new LSL_Rotation(presence.CameraRotation.X, presence.CameraRotation.Y, presence.CameraRotation.Z, presence.CameraRotation.W);
return new LSL_Rotation(presence.CameraRotation);
}
return new LSL_Rotation();
return Quaternion.Identity;
}
/// <summary>