diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 54 |
1 files changed, 39 insertions, 15 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index c0543fd..ff8d2fe 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -166,6 +166,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
166 | public static readonly float CHILDUPDATES_MOVEMENT = 100.0f; | 166 | public static readonly float CHILDUPDATES_MOVEMENT = 100.0f; |
167 | public static readonly float CHILDUPDATES_TIME = 2000f; // min time between child updates (ms) | 167 | public static readonly float CHILDUPDATES_TIME = 2000f; // min time between child updates (ms) |
168 | 168 | ||
169 | |||
169 | private UUID m_previusParcelUUID = UUID.Zero; | 170 | private UUID m_previusParcelUUID = UUID.Zero; |
170 | private UUID m_currentParcelUUID = UUID.Zero; | 171 | private UUID m_currentParcelUUID = UUID.Zero; |
171 | private bool m_previusParcelHide = false; | 172 | private bool m_previusParcelHide = false; |
@@ -1362,15 +1363,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
1362 | if (groundHeight > pos.Z) | 1363 | if (groundHeight > pos.Z) |
1363 | pos.Z = groundHeight; | 1364 | pos.Z = groundHeight; |
1364 | 1365 | ||
1366 | if (((m_teleportFlags & TeleportFlags.ViaMap) == 0) && (Math.Truncate(pos.Z) == pos.Z)) | ||
1367 | m_teleportFlags |= TeleportFlags.ViaMap; | ||
1365 | bool checkPhysics = !positionChanged && | 1368 | bool checkPhysics = !positionChanged && |
1366 | m_scene.SupportsRayCastFiltered() && | 1369 | m_scene.SupportsRayCastFiltered() && |
1367 | pos.Z < physTestHeight && | 1370 | pos.Z < physTestHeight && |
1368 | ((m_teleportFlags & (TeleportFlags.ViaLogin | TeleportFlags.ViaRegionID)) == | 1371 | ((m_teleportFlags & (TeleportFlags.ViaLogin | TeleportFlags.ViaRegionID)) == |
1369 | (TeleportFlags.ViaLogin | TeleportFlags.ViaRegionID) | 1372 | (TeleportFlags.ViaLogin | TeleportFlags.ViaRegionID) |
1370 | || (m_teleportFlags & TeleportFlags.ViaLocation) != 0 | 1373 | //// || (m_teleportFlags & TeleportFlags.ViaLocation) != 0 |
1374 | || (m_teleportFlags & TeleportFlags.ViaMap) != 0 | ||
1371 | || (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0); | 1375 | || (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0); |
1372 | 1376 | ||
1373 | if(checkPhysics && (m_teleportFlags & TeleportFlags.ViaScript) == 0) | 1377 | if(checkPhysics && ((m_teleportFlags & TeleportFlags.ViaScript) == 0)) |
1374 | { | 1378 | { |
1375 | // land check was done above | 1379 | // land check was done above |
1376 | RayFilterFlags rayfilter = RayFilterFlags.BackFaceCull; | 1380 | RayFilterFlags rayfilter = RayFilterFlags.BackFaceCull; |
@@ -1397,26 +1401,46 @@ namespace OpenSim.Region.Framework.Scenes | |||
1397 | return a.Depth.CompareTo(b.Depth); | 1401 | return a.Depth.CompareTo(b.Depth); |
1398 | }); | 1402 | }); |
1399 | 1403 | ||
1400 | int sel = 0; | 1404 | int sel = -1; |
1401 | int count = physresults.Count; | 1405 | int count = physresults.Count; |
1402 | float curd = physresults[0].Depth; | 1406 | float curd = physresults[0].Depth; |
1403 | float nextd = curd + PhysMinSkipGap; | 1407 | float nextd = curd + PhysMinSkipGap; |
1404 | float maxDepth = dist - pos.Z; | 1408 | float maxDepth = dist - pos.Z; |
1405 | for(int i = 1; i < count; i++) | 1409 | // Try to find a designated floor. |
1410 | for(int i = 0; i < count; i++) | ||
1406 | { | 1411 | { |
1407 | curd = physresults[i].Depth; | 1412 | SceneObjectPart part = m_scene.GetSceneObjectPart(physresults[i].ConsumerID); |
1408 | if(curd >= nextd) | 1413 | if ((null != part) && (string.Empty != part.Description) && ('^' == part.Description[0])) |
1409 | { | 1414 | { |
1410 | sel = i; | 1415 | sel = i; |
1411 | if(curd >= maxDepth) | 1416 | dest = physresults[sel].Pos.Z; |
1412 | break; | 1417 | break; |
1413 | } | 1418 | } |
1414 | nextd = curd + PhysMinSkipGap; | 1419 | } |
1420 | |||
1421 | if (-1 == sel) | ||
1422 | { | ||
1423 | sel = 0; | ||
1424 | for (int i = 1; i < count; i++) | ||
1425 | { | ||
1426 | curd = physresults[i].Depth; | ||
1427 | if(curd >= nextd) | ||
1428 | { | ||
1429 | sel = i; | ||
1430 | if(curd >= maxDepth) | ||
1431 | break; | ||
1432 | } | ||
1433 | nextd = curd + PhysMinSkipGap; | ||
1434 | } | ||
1435 | dest = physresults[sel].Pos.Z; | ||
1415 | } | 1436 | } |
1416 | dest = physresults[sel].Pos.Z; | ||
1417 | } | 1437 | } |
1418 | 1438 | ||
1419 | dest += localAVHalfHeight; | 1439 | dest += localAVHalfHeight; |
1440 | if ((m_teleportFlags & TeleportFlags.ViaMap) != 0) | ||
1441 | m_log.InfoFormat("[SCENE PRESENCE]: Teleport from above, for {0} @ {1}, landing height {2}", Name, pos, dest); | ||
1442 | else | ||
1443 | m_log.ErrorFormat("[SCENE PRESENCE]: Teleport from above NOMAP, for {0} @ {1}, landing height {2}", Name, pos, dest); | ||
1420 | if(dest > pos.Z) | 1444 | if(dest > pos.Z) |
1421 | pos.Z = dest; | 1445 | pos.Z = dest; |
1422 | } | 1446 | } |
@@ -1681,7 +1705,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1681 | AddToPhysicalScene(isFlying); | 1705 | AddToPhysicalScene(isFlying); |
1682 | SendTerseUpdateToAllClients(); | 1706 | SendTerseUpdateToAllClients(); |
1683 | } | 1707 | } |
1684 | 1708 | /* Not called from anywhere. | |
1685 | public void avnLocalTeleport(Vector3 newpos, Vector3? newvel, bool rotateToVelXY) | 1709 | public void avnLocalTeleport(Vector3 newpos, Vector3? newvel, bool rotateToVelXY) |
1686 | { | 1710 | { |
1687 | if(!CheckLocalTPLandingPoint(ref newpos)) | 1711 | if(!CheckLocalTPLandingPoint(ref newpos)) |
@@ -1715,7 +1739,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1715 | } | 1739 | } |
1716 | SendTerseUpdateToAllClients(); | 1740 | SendTerseUpdateToAllClients(); |
1717 | } | 1741 | } |
1718 | 1742 | */ | |
1719 | public void StopFlying() | 1743 | public void StopFlying() |
1720 | { | 1744 | { |
1721 | if (IsInTransit) | 1745 | if (IsInTransit) |