mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
Thank you kindly, Marcus Llewellyn, for a patch that:
An attachment with the physical checkbox checked will not allow the phantom checkbox to be cleared. This interfers with scripting functions such as llMoveToTarget(), which won't work while an object is phantom. If the prim containing the script is rezzed to the ground, it will then allow the phantom checlbox to be cleared, and the script works as expected.
This commit is contained in:
@@ -1596,11 +1596,31 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
SceneObjectPart rootpart = m_rootPart;
|
||||
if (rootpart != null)
|
||||
{
|
||||
if (rootpart.PhysActor != null)
|
||||
if (IsAttachment)
|
||||
{
|
||||
rootpart.PhysActor.PIDTarget = new PhysicsVector(target.X, target.Y, target.Z);
|
||||
rootpart.PhysActor.PIDTau = tau;
|
||||
rootpart.PhysActor.PIDActive = true;
|
||||
ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
|
||||
if (avatar != null)
|
||||
{
|
||||
List<string> coords = new List<string>();
|
||||
uint regionX = 0;
|
||||
uint regionY = 0;
|
||||
Utils.LongToUInts(Scene.RegionInfo.RegionHandle, out regionX, out regionY);
|
||||
target.X += regionX;
|
||||
target.Y += regionY;
|
||||
coords.Add(target.X.ToString());
|
||||
coords.Add(target.Y.ToString());
|
||||
coords.Add(target.Z.ToString());
|
||||
avatar.DoMoveToPosition(avatar, "", coords);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rootpart.PhysActor != null)
|
||||
{
|
||||
rootpart.PhysActor.PIDTarget = new PhysicsVector(target.X, target.Y, target.Z);
|
||||
rootpart.PhysActor.PIDTau = tau;
|
||||
rootpart.PhysActor.PIDActive = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user