refactor: Use SOP.SitTargetAvatar instead of calling a special GetAvatarOnSitTarget() which returned exactly the same thing
parent
8905f34e18
commit
614ea5a48a
|
@ -1220,6 +1220,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ID of the avatar that is sat on us. If there is no such avatar then is UUID.Zero
|
||||||
|
/// </summary>
|
||||||
public UUID SitTargetAvatar
|
public UUID SitTargetAvatar
|
||||||
{
|
{
|
||||||
get { return m_sitTargetAvatar; }
|
get { return m_sitTargetAvatar; }
|
||||||
|
@ -1886,11 +1889,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return part;
|
return part;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID GetAvatarOnSitTarget()
|
|
||||||
{
|
|
||||||
return m_sitTargetAvatar;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool GetDieAtEdge()
|
public bool GetDieAtEdge()
|
||||||
{
|
{
|
||||||
if (m_parentGroup.IsDeleted)
|
if (m_parentGroup.IsDeleted)
|
||||||
|
|
|
@ -1834,11 +1834,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
4); // PERMISSION_TAKE_CONTROLS
|
4); // PERMISSION_TAKE_CONTROLS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset sit target.
|
// Reset sit target.
|
||||||
if (part.GetAvatarOnSitTarget() == UUID)
|
if (part.SitTargetAvatar == UUID)
|
||||||
part.SitTargetAvatar = UUID.Zero;
|
part.SitTargetAvatar = UUID.Zero;
|
||||||
|
|
||||||
part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
|
part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
|
||||||
|
|
||||||
m_parentPosition = part.GetWorldPosition();
|
m_parentPosition = part.GetWorldPosition();
|
||||||
|
@ -1887,7 +1888,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// Is a sit target available?
|
// Is a sit target available?
|
||||||
Vector3 avSitOffSet = part.SitTargetPosition;
|
Vector3 avSitOffSet = part.SitTargetPosition;
|
||||||
Quaternion avSitOrientation = part.SitTargetOrientation;
|
Quaternion avSitOrientation = part.SitTargetOrientation;
|
||||||
UUID avOnTargetAlready = part.GetAvatarOnSitTarget();
|
UUID avOnTargetAlready = part.SitTargetAvatar;
|
||||||
|
|
||||||
bool SitTargetUnOccupied = (!(avOnTargetAlready != UUID.Zero));
|
bool SitTargetUnOccupied = (!(avOnTargetAlready != UUID.Zero));
|
||||||
bool SitTargetisSet =
|
bool SitTargetisSet =
|
||||||
|
@ -1924,7 +1925,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// Is a sit target available?
|
// Is a sit target available?
|
||||||
Vector3 avSitOffSet = part.SitTargetPosition;
|
Vector3 avSitOffSet = part.SitTargetPosition;
|
||||||
Quaternion avSitOrientation = part.SitTargetOrientation;
|
Quaternion avSitOrientation = part.SitTargetOrientation;
|
||||||
UUID avOnTargetAlready = part.GetAvatarOnSitTarget();
|
UUID avOnTargetAlready = part.SitTargetAvatar;
|
||||||
|
|
||||||
bool SitTargetUnOccupied = (!(avOnTargetAlready != UUID.Zero));
|
bool SitTargetUnOccupied = (!(avOnTargetAlready != UUID.Zero));
|
||||||
bool SitTargetisSet =
|
bool SitTargetisSet =
|
||||||
|
@ -2252,7 +2253,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
if (part.GetAvatarOnSitTarget() == UUID)
|
if (part.SitTargetAvatar == UUID)
|
||||||
{
|
{
|
||||||
Vector3 sitTargetPos = part.SitTargetPosition;
|
Vector3 sitTargetPos = part.SitTargetPosition;
|
||||||
Quaternion sitTargetOrient = part.SitTargetOrientation;
|
Quaternion sitTargetOrient = part.SitTargetOrientation;
|
||||||
|
|
|
@ -6347,7 +6347,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
public LSL_String llAvatarOnSitTarget()
|
public LSL_String llAvatarOnSitTarget()
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
return m_host.GetAvatarOnSitTarget().ToString();
|
return m_host.SitTargetAvatar.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// http://wiki.secondlife.com/wiki/LlAvatarOnLinkSitTarget
|
// http://wiki.secondlife.com/wiki/LlAvatarOnLinkSitTarget
|
||||||
|
|
Loading…
Reference in New Issue