Second part of the fix for llGetLocalPos; get attachment offset in the root prim of an attachment. This function now behaves in line with SL.

avinationmerge
Tom Grimshaw 2010-07-13 14:57:50 -07:00
parent 8c2e1c6c29
commit 7270cd0ade
1 changed files with 15 additions and 6 deletions

View File

@ -2137,11 +2137,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if (m_host.IsAttachment == true) { if (m_host.IsAttachment == true) {
//m_log.DebugFormat("[localpos]: {0}) {1} {2}",m_host.OffsetPosition.X,m_host.OffsetPosition.Y,m_host.OffsetPosition.Z); if (m_host.IsRoot == true)
{
return new LSL_Vector(m_host.AbsolutePosition.X,
m_host.AbsolutePosition.Y,
m_host.AbsolutePosition.Z);
}
else
{
return new LSL_Vector(m_host.OffsetPosition.X, return new LSL_Vector(m_host.OffsetPosition.X,
m_host.OffsetPosition.Y, m_host.OffsetPosition.Y,
m_host.OffsetPosition.Z); m_host.OffsetPosition.Z);
} }
}
if (m_host.ParentID != 0) if (m_host.ParentID != 0)
{ {