From 0daece6f2b8c14f9de02aabfa136135161083bc2 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 10 Nov 2011 23:15:03 +0100
Subject: Fix turn left and turn right properly. Works for both built-ins and
LSL AOs
---
.../Framework/Scenes/Animation/ScenePresenceAnimator.cs | 17 +++++++++++------
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 +++++
2 files changed, 16 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index 05cdf61..4cf854e 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -180,12 +180,17 @@ namespace OpenSim.Region.Framework.Scenes.Animation
bool heldBack = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG);
bool heldLeft = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS);
bool heldRight = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG);
- //bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT;
- //bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT;
+ bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT;
+ bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT;
bool heldUp = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) == AgentManager.ControlFlags.AGENT_CONTROL_UP_POS;
bool heldDown = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG;
//bool flying = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) == AgentManager.ControlFlags.AGENT_CONTROL_FLY;
//bool mouselook = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) == AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK;
+ if (heldForward || heldBack || heldLeft || heldRight || heldUp || heldDown)
+ {
+ heldTurnLeft = false;
+ heldTurnRight = false;
+ }
// Direction in which the avatar is trying to move
Vector3 move = Vector3.Zero;
@@ -363,10 +368,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
// Not walking
if (move.Z < 0)
return "CROUCH";
-// else if (heldTurnLeft)
-// return "TURNLEFT";
-// else if (heldTurnRight)
-// return "TURNRIGHT";
+ else if (heldTurnLeft)
+ return "TURNLEFT";
+ else if (heldTurnRight)
+ return "TURNRIGHT";
else
return "STAND";
}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index e662492..fdf944b 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1387,6 +1387,11 @@ namespace OpenSim.Region.Framework.Scenes
if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0)
m_updateCount = UPDATE_COUNT;
+ // Make turning in place work
+ if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_POS) != 0 ||
+ (flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_NEG) != 0)
+ m_updateCount = UPDATE_COUNT;
+
if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0)
{
StandUp();
--
cgit v1.1
From a5838cf0a689facd58bc17f11ed6c312ef541aab Mon Sep 17 00:00:00 2001
From: Melanie
Date: Fri, 11 Nov 2011 00:28:12 +0000
Subject: Prevent linking objects while they are deeded. On unlinking deeded
objects, set LastOwnerID properly so the parts cannot be transferred,
circumventing no trans perms
---
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index b2e5dc3..743fd50 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1661,6 +1661,13 @@ namespace OpenSim.Region.Framework.Scenes
///
protected internal void LinkObjects(SceneObjectPart root, List children)
{
+ SceneObjectGroup parentGroup = root.ParentGroup;
+ if (parentGroup == null) return;
+
+ // Cowardly refuse to link to a group owned root
+ if (parentGroup.OwnerID == parentGroup.GroupID)
+ return;
+
Monitor.Enter(m_updateLock);
try
{
@@ -1683,11 +1690,14 @@ namespace OpenSim.Region.Framework.Scenes
foreach (SceneObjectGroup child in childGroups)
{
- parentGroup.LinkToGroup(child);
+ if (parentGroup.OwnerID == child.OwnerID)
+ {
+ parentGroup.LinkToGroup(child);
- // this is here so physics gets updated!
- // Don't remove! Bad juju! Stay away! or fix physics!
- child.AbsolutePosition = child.AbsolutePosition;
+ // this is here so physics gets updated!
+ // Don't remove! Bad juju! Stay away! or fix physics!
+ child.AbsolutePosition = child.AbsolutePosition;
+ }
}
// We need to explicitly resend the newly link prim's object properties since no other actions
@@ -1725,9 +1735,14 @@ namespace OpenSim.Region.Framework.Scenes
if (part.ParentGroup.PrimCount != 1) // Skip single
{
if (part.LinkNum < 2) // Root
+ {
rootParts.Add(part);
+ }
else
+ {
+ part.LastOwnerID = part.ParentGroup.RootPart.LastOwnerID;
childParts.Add(part);
+ }
SceneObjectGroup group = part.ParentGroup;
if (!affectedGroups.Contains(group))
--
cgit v1.1