aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs61
1 files changed, 26 insertions, 35 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 91f9c0b..a57e0d1 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -221,8 +221,6 @@ namespace OpenSim.Region.Framework.Scenes
221 221
222 private Quaternion m_headrotation = Quaternion.Identity; 222 private Quaternion m_headrotation = Quaternion.Identity;
223 223
224 private string m_nextSitAnimation = String.Empty;
225
226 //PauPaw:Proper PID Controler for autopilot************ 224 //PauPaw:Proper PID Controler for autopilot************
227 public bool MovingToTarget { get; private set; } 225 public bool MovingToTarget { get; private set; }
228 public Vector3 MoveToPositionTarget { get; private set; } 226 public Vector3 MoveToPositionTarget { get; private set; }
@@ -598,18 +596,18 @@ namespace OpenSim.Region.Framework.Scenes
598 set 596 set
599 { 597 {
600 m_bodyRot = value; 598 m_bodyRot = value;
601 // m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, m_bodyRot);
602 if (PhysicsActor != null) 599 if (PhysicsActor != null)
603 { 600 {
604 try 601 try
605 { 602 {
606 PhysicsActor.Orientation = value; 603 PhysicsActor.Orientation = m_bodyRot;
607 } 604 }
608 catch (Exception e) 605 catch (Exception e)
609 { 606 {
610 m_log.Error("[SCENE PRESENCE]: Orientation " + e.Message); 607 m_log.Error("[SCENE PRESENCE]: Orientation " + e.Message);
611 } 608 }
612 } 609 }
610// m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, m_bodyRot);
613 } 611 }
614 } 612 }
615 613
@@ -2322,28 +2320,16 @@ namespace OpenSim.Region.Framework.Scenes
2322 2320
2323 if (ParentID != 0) 2321 if (ParentID != 0)
2324 { 2322 {
2323 if (ParentPart.UUID == targetID)
2324 return; // already sitting here, ignore
2325
2325 StandUp(); 2326 StandUp();
2326 } 2327 }
2327 2328
2328// if (!String.IsNullOrEmpty(sitAnimation))
2329// {
2330// m_nextSitAnimation = sitAnimation;
2331// }
2332// else
2333// {
2334 m_nextSitAnimation = "SIT";
2335// }
2336
2337 //SceneObjectPart part = m_scene.GetSceneObjectPart(targetID);
2338 SceneObjectPart part = FindNextAvailableSitTarget(targetID); 2329 SceneObjectPart part = FindNextAvailableSitTarget(targetID);
2339 2330
2340 if (part != null) 2331 if (part != null)
2341 { 2332 {
2342 if (!String.IsNullOrEmpty(part.SitAnimation))
2343 {
2344 m_nextSitAnimation = part.SitAnimation;
2345 }
2346
2347 m_requestedSitTargetID = part.LocalId; 2333 m_requestedSitTargetID = part.LocalId;
2348 m_requestedSitTargetUUID = targetID; 2334 m_requestedSitTargetUUID = targetID;
2349 2335
@@ -2464,18 +2450,6 @@ namespace OpenSim.Region.Framework.Scenes
2464 2450
2465 public void HandleAgentSit(IClientAPI remoteClient, UUID agentID) 2451 public void HandleAgentSit(IClientAPI remoteClient, UUID agentID)
2466 { 2452 {
2467 if (!String.IsNullOrEmpty(m_nextSitAnimation))
2468 {
2469 HandleAgentSit(remoteClient, agentID, m_nextSitAnimation);
2470 }
2471 else
2472 {
2473 HandleAgentSit(remoteClient, agentID, "SIT");
2474 }
2475 }
2476
2477 public void HandleAgentSit(IClientAPI remoteClient, UUID agentID, string sitAnimation)
2478 {
2479 SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID); 2453 SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
2480 2454
2481 if (part != null) 2455 if (part != null)
@@ -2545,10 +2519,15 @@ namespace OpenSim.Region.Framework.Scenes
2545 2519
2546 ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID); 2520 ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
2547 ParentID = m_requestedSitTargetID; 2521 ParentID = m_requestedSitTargetID;
2548 2522 m_AngularVelocity = Vector3.Zero;
2549 Velocity = Vector3.Zero; 2523 Velocity = Vector3.Zero;
2550 RemoveFromPhysicalScene(); 2524 RemoveFromPhysicalScene();
2551 2525
2526 String sitAnimation = "SIT";
2527 if (!String.IsNullOrEmpty(part.SitAnimation))
2528 {
2529 sitAnimation = part.SitAnimation;
2530 }
2552 Animator.TrySetMovementAnimation(sitAnimation); 2531 Animator.TrySetMovementAnimation(sitAnimation);
2553 SendAvatarDataToAllAgents(); 2532 SendAvatarDataToAllAgents();
2554 } 2533 }
@@ -2556,7 +2535,8 @@ namespace OpenSim.Region.Framework.Scenes
2556 2535
2557 public void HandleAgentSitOnGround() 2536 public void HandleAgentSitOnGround()
2558 { 2537 {
2559// m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick. 2538// m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick..
2539 m_AngularVelocity = Vector3.Zero;
2560 Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); 2540 Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED");
2561 SitGround = true; 2541 SitGround = true;
2562 RemoveFromPhysicalScene(); 2542 RemoveFromPhysicalScene();
@@ -2578,7 +2558,7 @@ namespace OpenSim.Region.Framework.Scenes
2578 2558
2579 public void HandleStopAnim(IClientAPI remoteClient, UUID animID) 2559 public void HandleStopAnim(IClientAPI remoteClient, UUID animID)
2580 { 2560 {
2581 Animator.RemoveAnimation(animID); 2561 Animator.RemoveAnimation(animID, false);
2582 } 2562 }
2583 2563
2584 public void avnHandleChangeAnim(UUID animID, bool addRemove,bool sendPack) 2564 public void avnHandleChangeAnim(UUID animID, bool addRemove,bool sendPack)
@@ -4289,6 +4269,7 @@ namespace OpenSim.Region.Framework.Scenes
4289 (m_teleportFlags & TeleportFlags.ViaLocation) != 0 || 4269 (m_teleportFlags & TeleportFlags.ViaLocation) != 0 ||
4290 (m_teleportFlags & Constants.TeleportFlags.ViaHGLogin) != 0) 4270 (m_teleportFlags & Constants.TeleportFlags.ViaHGLogin) != 0)
4291 { 4271 {
4272
4292 if (GodLevel < 200 && 4273 if (GodLevel < 200 &&
4293 ((!m_scene.Permissions.IsGod(m_uuid) && 4274 ((!m_scene.Permissions.IsGod(m_uuid) &&
4294 !m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid)) || 4275 !m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid)) ||
@@ -4297,7 +4278,14 @@ namespace OpenSim.Region.Framework.Scenes
4297 { 4278 {
4298 SpawnPoint[] spawnPoints = m_scene.RegionInfo.RegionSettings.SpawnPoints().ToArray(); 4279 SpawnPoint[] spawnPoints = m_scene.RegionInfo.RegionSettings.SpawnPoints().ToArray();
4299 if (spawnPoints.Length == 0) 4280 if (spawnPoints.Length == 0)
4281 {
4282 if(m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid))
4283 {
4284 pos.X = 128.0f;
4285 pos.Y = 128.0f;
4286 }
4300 return; 4287 return;
4288 }
4301 4289
4302 int index; 4290 int index;
4303 bool selected = false; 4291 bool selected = false;
@@ -4306,6 +4294,8 @@ namespace OpenSim.Region.Framework.Scenes
4306 { 4294 {
4307 case "random": 4295 case "random":
4308 4296
4297 if (spawnPoints.Length == 0)
4298 return;
4309 do 4299 do
4310 { 4300 {
4311 index = Util.RandomClass.Next(spawnPoints.Length - 1); 4301 index = Util.RandomClass.Next(spawnPoints.Length - 1);
@@ -4317,6 +4307,7 @@ namespace OpenSim.Region.Framework.Scenes
4317 // SpawnPoint sp = spawnPoints[index]; 4307 // SpawnPoint sp = spawnPoints[index];
4318 4308
4319 ILandObject land = m_scene.LandChannel.GetLandObject(spawnPosition.X, spawnPosition.Y); 4309 ILandObject land = m_scene.LandChannel.GetLandObject(spawnPosition.X, spawnPosition.Y);
4310
4320 if (land == null || land.IsEitherBannedOrRestricted(UUID)) 4311 if (land == null || land.IsEitherBannedOrRestricted(UUID))
4321 selected = false; 4312 selected = false;
4322 else 4313 else