mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
Fix sensors, llGetRootRotation(), llGet*Param() and other functions to use the world rotation if the avatar to which they are attached is sitting
This commit is contained in:
@@ -2578,18 +2578,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
UUID npcId;
|
||||
if (!UUID.TryParse(npc.m_string, out npcId))
|
||||
return new LSL_Rotation(Quaternion.Identity.X, Quaternion.Identity.Y, Quaternion.Identity.Z, Quaternion.Identity.W);
|
||||
return new LSL_Rotation(Quaternion.Identity);
|
||||
|
||||
if (!npcModule.CheckPermissions(npcId, m_host.OwnerID))
|
||||
return new LSL_Rotation(Quaternion.Identity.X, Quaternion.Identity.Y, Quaternion.Identity.Z, Quaternion.Identity.W);
|
||||
return new LSL_Rotation(Quaternion.Identity);
|
||||
|
||||
ScenePresence sp = World.GetScenePresence(npcId);
|
||||
|
||||
if (sp != null)
|
||||
{
|
||||
Quaternion rot = sp.Rotation;
|
||||
return new LSL_Rotation(rot.X, rot.Y, rot.Z, rot.W);
|
||||
}
|
||||
return new LSL_Rotation(sp.GetWorldRotation());
|
||||
}
|
||||
|
||||
return new LSL_Rotation(Quaternion.Identity.X, Quaternion.Identity.Y, Quaternion.Identity.Z, Quaternion.Identity.W);
|
||||
|
||||
Reference in New Issue
Block a user