mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
let llSetBuoyancy work on attachments. But unlike at sl, the effect is not removed when the script or its prim is removed/deattached. SO use with care. THis lmitation was a reason why we did not let is work on attachments
This commit is contained in:
@@ -1602,14 +1602,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
set
|
||||
{
|
||||
if (ParentGroup != null && ParentGroup.RootPart != null && ParentGroup.RootPart != this)
|
||||
if (ParentGroup != null)
|
||||
{
|
||||
ParentGroup.RootPart.Buoyancy = value;
|
||||
return;
|
||||
if (ParentGroup.RootPart != null && ParentGroup.RootPart != this)
|
||||
{
|
||||
ParentGroup.RootPart.Buoyancy = value;
|
||||
return;
|
||||
}
|
||||
if (ParentGroup.IsAttachment)
|
||||
{
|
||||
ScenePresence avatar = m_scene.GetScenePresence(ParentGroup.AttachedAvatar);
|
||||
PhysicsActor pa = avatar?.PhysicsActor;
|
||||
if (pa != null)
|
||||
pa.Buoyancy = value;
|
||||
}
|
||||
else if (PhysActor != null)
|
||||
PhysActor.Buoyancy = value;
|
||||
}
|
||||
m_buoyancy = value;
|
||||
if (PhysActor != null)
|
||||
PhysActor.Buoyancy = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user