Fix prim link numbers (Mantis #1781)

Implements additional unlink modes (unlink root prim from link set, some
multi-set operations). Linking (single and mutiple) fully implemented.
Consistent numbering of links while in world. Link/delink with predictable
link numbering. Correct link numbers in LSL.
Not all multi-set ops implemented. Link numbers still change when taken and
re-rezzed.
This commit is contained in:
Melanie Thielker
2008-07-19 04:05:34 +00:00
parent a73d87ef16
commit bcf74416a1
7 changed files with 148 additions and 47 deletions

View File

@@ -2600,7 +2600,7 @@ namespace OpenSim.Region.ScriptEngine.Common
if (m_host.ParentGroup.Children.Count > 1)
{
return m_host.LinkNum + 1;
return m_host.LinkNum;
}
else
{
@@ -2979,7 +2979,7 @@ namespace OpenSim.Region.ScriptEngine.Common
object[] resobj = new object[]
{
new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
};
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
@@ -3004,7 +3004,7 @@ namespace OpenSim.Region.ScriptEngine.Common
partItemID = item.ItemID;
Object[] resobj = new object[]
{
new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
};
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
@@ -3032,7 +3032,7 @@ namespace OpenSim.Region.ScriptEngine.Common
partItemID = item.ItemID;
Object[] resobj = new object[]
{
new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
};
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
@@ -3062,7 +3062,7 @@ namespace OpenSim.Region.ScriptEngine.Common
partItemID = item.ItemID;
Object[] resobj = new object[]
{
new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
};
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
@@ -3086,7 +3086,7 @@ namespace OpenSim.Region.ScriptEngine.Common
object[] resobj = new object[]
{
new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
};
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
@@ -3103,7 +3103,7 @@ namespace OpenSim.Region.ScriptEngine.Common
foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts())
{
if ((partInst.LinkNum + 1) == linknum)
if ((partInst.LinkNum) == linknum)
{
foreach (TaskInventoryItem item in partInst.TaskInventory.Values)
@@ -3114,7 +3114,7 @@ namespace OpenSim.Region.ScriptEngine.Common
partItemID = item.ItemID;
Object[] resObjDef = new object[]
{
new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
};
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
@@ -5246,7 +5246,7 @@ namespace OpenSim.Region.ScriptEngine.Common
{
foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts())
{
if ((partInst.LinkNum + 1) == linknumber)
if ((partInst.LinkNum) == linknumber)
{
part = partInst;
break;

View File

@@ -2487,7 +2487,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (m_host.ParentGroup.Children.Count > 1)
{
return m_host.LinkNum + 1;
return m_host.LinkNum;
}
else
{
@@ -2923,7 +2923,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
object[] resobj = new object[]
{
new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
};
m_ScriptEngine.PostScriptEvent(partItemID,
@@ -2947,7 +2947,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
partItemID = item.ItemID;
Object[] resobj = new object[]
{
new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
};
m_ScriptEngine.PostScriptEvent(partItemID,
@@ -2975,7 +2975,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
partItemID = item.ItemID;
Object[] resobj = new object[]
{
new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
};
m_ScriptEngine.PostScriptEvent(partItemID,
@@ -3005,7 +3005,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
partItemID = item.ItemID;
Object[] resobj = new object[]
{
new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
};
m_ScriptEngine.PostScriptEvent(partItemID,
@@ -3029,7 +3029,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
object[] resobj = new object[]
{
new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
};
m_ScriptEngine.PostScriptEvent(partItemID,
@@ -3045,7 +3045,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts())
{
if ((partInst.LinkNum + 1) == linknum)
if ((partInst.LinkNum) == linknum)
{
foreach (TaskInventoryItem item in partInst.TaskInventory.Values)
@@ -3056,7 +3056,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
partItemID = item.ItemID;
Object[] resObjDef = new object[]
{
new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
};
m_ScriptEngine.PostScriptEvent(partItemID,
@@ -5046,7 +5046,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts())
{
if ((partInst.LinkNum + 1) == linknumber)
if ((partInst.LinkNum) == linknumber)
{
part = partInst;
break;

View File

@@ -93,9 +93,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (part == null)
return;
det[0].LinkNum = 0;
if (part.ParentGroup.Children.Count > 0)
det[0].LinkNum = part.LinkNum + 1;
det[0].LinkNum = part.LinkNum;
myScriptEngine.PostObjectEvent(localID, new EventParams(
"touch_start", new Object[] { new LSL_Types.LSLInteger(1) },
@@ -119,9 +117,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (part == null)
return;
det[0].LinkNum = 0;
if (part.ParentGroup.Children.Count > 0)
det[0].LinkNum = part.LinkNum + 1;
det[0].LinkNum = part.LinkNum;
myScriptEngine.PostObjectEvent(localID, new EventParams(
"touch", new Object[] { new LSL_Types.LSLInteger(1) },
@@ -141,9 +137,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (part == null)
return;
det[0].LinkNum = 0;
if (part.ParentGroup.Children.Count > 0)
det[0].LinkNum = part.LinkNum + 1;
det[0].LinkNum = part.LinkNum;
myScriptEngine.PostObjectEvent(localID, new EventParams(
"touch_end", new Object[] { new LSL_Types.LSLInteger(1) },