From 6bd8e1eb99f8268e09a07843da6f5dbbcb0cfff4 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Tue, 21 Apr 2009 15:52:35 +0000 Subject: Thank you kindly, MPallari for a patch that: This patch adds few properties to ScenePresence and thus allows region module or MRM script: 1. Force flying for avatar or, 2. Disable flying from avatar --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 33 ++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 7300a24..d8ce080 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -121,6 +121,8 @@ namespace OpenSim.Region.Framework.Scenes private bool m_allowFalling = false; private bool m_useFlySlow = false; private bool m_usePreJump = false; + private bool m_forceFly = false; + private bool m_flyDisabled = false; private float m_speedModifier = 1.0f; @@ -571,6 +573,18 @@ namespace OpenSim.Region.Framework.Scenes set { m_speedModifier = value; } } + public bool ForceFly + { + get { return m_forceFly; } + set { m_forceFly = value; } + } + + public bool FlyDisabled + { + get { return m_flyDisabled; } + set { m_flyDisabled = value; } + } + #endregion #region Constructor(s) @@ -880,6 +894,16 @@ namespace OpenSim.Region.Framework.Scenes AbsolutePosition = pos; AddToPhysicalScene(isFlying); + + if (m_forceFly) + { + m_physicsActor.Flying = true; + } + else if (m_flyDisabled) + { + m_physicsActor.Flying = false; + } + if (m_appearance != null) { if (m_appearance.AvatarHeight > 0) @@ -1223,7 +1247,12 @@ namespace OpenSim.Region.Framework.Scenes { bool oldflying = PhysicsActor.Flying; - PhysicsActor.Flying = ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); + if (m_forceFly) + PhysicsActor.Flying = true; + else if (m_flyDisabled) + PhysicsActor.Flying = false; + else + PhysicsActor.Flying = ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); if (PhysicsActor.Flying != oldflying) { @@ -1380,7 +1409,7 @@ namespace OpenSim.Region.Framework.Scenes // with something with the down arrow pressed. // Only do this if we're flying - if (m_physicsActor != null && m_physicsActor.Flying) + if (m_physicsActor != null && m_physicsActor.Flying && !m_forceFly) { // Are the landing controls requirements filled? bool controlland = (((flags & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) || -- cgit v1.1