From 6d8da699b275cf9a52214de3b22256533b7bb784 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Sat, 19 Jun 2010 07:00:01 -0700 Subject: Add "AvatarHeight/2" to the Home Position when set to avoid having the avatar fall through the ground when they TP home. --- OpenSim/Region/Framework/Scenes/Scene.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 97de147..dc58d84 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3235,6 +3235,16 @@ namespace OpenSim.Region.Framework.Scenes /// public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags) { + //Add half the avatar's height so that the user doesn't fall through prims + ScenePresence presence; + if (TryGetScenePresence(remoteClient.AgentId, out presence)) + { + if (presence.Appearance != null) + { + position.Z = position.Z + (presence.Appearance.AvatarHeight / 2); + } + } + if (GridUserService != null && GridUserService.SetHome(remoteClient.AgentId.ToString(), RegionInfo.RegionID, position, lookAt)) // FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot. m_dialogModule.SendAlertToUser(remoteClient, "Home position set."); -- cgit v1.1