Stop teleports from dropping tall avatars through or embedding them in the floor when lured by short avatars.

This involves giving the ceiling of the Z-component in a lure rather than the floor.
Ideally we would give the exact float compensating for relative avatar height but it looks like that isn't possible with the parcel id format used in lures
0.7.4.1
Justin Clark-Casey (justincc) 2012-04-20 02:50:36 +01:00
parent beb7b8d189
commit 2b98e2f106
1 changed files with 7 additions and 1 deletions

View File

@ -151,11 +151,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
Scene scene = (Scene)(client.Scene); Scene scene = (Scene)(client.Scene);
ScenePresence presence = scene.GetScenePresence(client.AgentId); ScenePresence presence = scene.GetScenePresence(client.AgentId);
// Round up Z co-ordinate rather than round-down by casting. This stops tall avatars from being given
// a teleport Z co-ordinate by short avatars that drops them through or embeds them in thin floors on
// arrival.
//
// Ideally we would give the exact float position adjusting for the relative height of the two avatars
// but it looks like a float component isn't possible with a parcel ID.
UUID dest = Util.BuildFakeParcelID( UUID dest = Util.BuildFakeParcelID(
scene.RegionInfo.RegionHandle, scene.RegionInfo.RegionHandle,
(uint)presence.AbsolutePosition.X, (uint)presence.AbsolutePosition.X,
(uint)presence.AbsolutePosition.Y, (uint)presence.AbsolutePosition.Y,
(uint)presence.AbsolutePosition.Z); (uint)Math.Ceiling(presence.AbsolutePosition.Z));
m_log.DebugFormat("TP invite with message {0}", message); m_log.DebugFormat("TP invite with message {0}", message);