Convert the lsl list type into a struct. EXPERIMENTAL! This may affect

the llSetPrimitiveParams family of functions adversely. Please test!
0.8.2-post-fixes
Melanie Thielker 2015-08-19 23:14:11 +02:00
parent 25335b0707
commit 662b59af83
4 changed files with 172 additions and 172 deletions

View File

@ -416,7 +416,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
if (type == typeof(object[])) if (type == typeof(object[]))
{ {
object[] plist = (lslparm as LSL_List).Data; object[] plist = ((LSL_List)lslparm).Data;
object[] result = new object[plist.Length]; object[] result = new object[plist.Length];
for (int i = 0; i < plist.Length; i++) for (int i = 0; i < plist.Length; i++)
{ {

View File

@ -2473,14 +2473,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// on the ILSL_Api interface. // on the ILSL_Api interface.
LSL_Api LSL_Api = (LSL_Api)m_LSL_Api; LSL_Api LSL_Api = (LSL_Api)m_LSL_Api;
LSL_List retVal = new LSL_List(); LSL_List retVal = new LSL_List();
LSL_List remaining = null; LSL_List remaining;
List<SceneObjectPart> parts = LSL_Api.GetLinkParts(linknumber); List<SceneObjectPart> parts = LSL_Api.GetLinkParts(linknumber);
foreach (SceneObjectPart part in parts) foreach (SceneObjectPart part in parts)
{ {
remaining = LSL_Api.GetPrimParams(part, rules, ref retVal); remaining = LSL_Api.GetPrimParams(part, rules, ref retVal);
} }
while (remaining != null && remaining.Length > 2) while (remaining.Length > 2)
{ {
linknumber = remaining.GetLSLIntegerItem(0); linknumber = remaining.GetLSLIntegerItem(0);
rules = remaining.GetSublist(1, -1); rules = remaining.GetSublist(1, -1);

View File

@ -502,7 +502,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
} }
[Serializable] [Serializable]
public class list public struct list
{ {
private object[] m_data; private object[] m_data;
@ -909,7 +909,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
else else
{ {
list result = null; list result;
// If end is negative, then prefix list is empty // If end is negative, then prefix list is empty
if (end < 0) if (end < 0)