aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorCharles Krinke2009-04-21 15:52:35 +0000
committerCharles Krinke2009-04-21 15:52:35 +0000
commit6bd8e1eb99f8268e09a07843da6f5dbbcb0cfff4 (patch)
tree8b4faf311d78e6ac68135edc89bac401ef7a420a
parentUpdate svn properties. (diff)
downloadopensim-SC_OLD-6bd8e1eb99f8268e09a07843da6f5dbbcb0cfff4.zip
opensim-SC_OLD-6bd8e1eb99f8268e09a07843da6f5dbbcb0cfff4.tar.gz
opensim-SC_OLD-6bd8e1eb99f8268e09a07843da6f5dbbcb0cfff4.tar.bz2
opensim-SC_OLD-6bd8e1eb99f8268e09a07843da6f5dbbcb0cfff4.tar.xz
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
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs33
1 files changed, 31 insertions, 2 deletions
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
121 private bool m_allowFalling = false; 121 private bool m_allowFalling = false;
122 private bool m_useFlySlow = false; 122 private bool m_useFlySlow = false;
123 private bool m_usePreJump = false; 123 private bool m_usePreJump = false;
124 private bool m_forceFly = false;
125 private bool m_flyDisabled = false;
124 126
125 private float m_speedModifier = 1.0f; 127 private float m_speedModifier = 1.0f;
126 128
@@ -571,6 +573,18 @@ namespace OpenSim.Region.Framework.Scenes
571 set { m_speedModifier = value; } 573 set { m_speedModifier = value; }
572 } 574 }
573 575
576 public bool ForceFly
577 {
578 get { return m_forceFly; }
579 set { m_forceFly = value; }
580 }
581
582 public bool FlyDisabled
583 {
584 get { return m_flyDisabled; }
585 set { m_flyDisabled = value; }
586 }
587
574 #endregion 588 #endregion
575 589
576 #region Constructor(s) 590 #region Constructor(s)
@@ -880,6 +894,16 @@ namespace OpenSim.Region.Framework.Scenes
880 AbsolutePosition = pos; 894 AbsolutePosition = pos;
881 895
882 AddToPhysicalScene(isFlying); 896 AddToPhysicalScene(isFlying);
897
898 if (m_forceFly)
899 {
900 m_physicsActor.Flying = true;
901 }
902 else if (m_flyDisabled)
903 {
904 m_physicsActor.Flying = false;
905 }
906
883 if (m_appearance != null) 907 if (m_appearance != null)
884 { 908 {
885 if (m_appearance.AvatarHeight > 0) 909 if (m_appearance.AvatarHeight > 0)
@@ -1223,7 +1247,12 @@ namespace OpenSim.Region.Framework.Scenes
1223 { 1247 {
1224 bool oldflying = PhysicsActor.Flying; 1248 bool oldflying = PhysicsActor.Flying;
1225 1249
1226 PhysicsActor.Flying = ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); 1250 if (m_forceFly)
1251 PhysicsActor.Flying = true;
1252 else if (m_flyDisabled)
1253 PhysicsActor.Flying = false;
1254 else
1255 PhysicsActor.Flying = ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0);
1227 1256
1228 if (PhysicsActor.Flying != oldflying) 1257 if (PhysicsActor.Flying != oldflying)
1229 { 1258 {
@@ -1380,7 +1409,7 @@ namespace OpenSim.Region.Framework.Scenes
1380 // with something with the down arrow pressed. 1409 // with something with the down arrow pressed.
1381 1410
1382 // Only do this if we're flying 1411 // Only do this if we're flying
1383 if (m_physicsActor != null && m_physicsActor.Flying) 1412 if (m_physicsActor != null && m_physicsActor.Flying && !m_forceFly)
1384 { 1413 {
1385 // Are the landing controls requirements filled? 1414 // Are the landing controls requirements filled?
1386 bool controlland = (((flags & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) || 1415 bool controlland = (((flags & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) ||