I dont realy know if this is the right place for this, but as I have diffrent waking houres than Lax

All functions returning List<Region> seem to be generating a IndexOutOfBounds problem.
Functions I tested by now include
DescendantsWithin.
NearestChildren, and
RegionsWithin
But I am guessing it apply to all of them.
I have tried to replicte the DescendantsWithin with
Code: Select all
public List<Region> DescendantsWithin(Region _base,double X, double Y, double Z, double MaxDist)
{
List<Region> list2 = new List<Region>();
LavishScriptObject obj1 = LavishScript.Objects.NewObject("index:lnavregionref");
if (obj1 == null)
{
return null;
}
int num1 = _base.GetMember<int>("DescendantsWithin", obj1.GetLSReference(), MaxDist.ToString(), X.ToString(), Y.ToString(), Z.ToString());
OnLog("in DescendantsWithin() num1="+num1.ToString());
if (num1 <= 0)
{
return null;
}
List<Region> list1 = new List<Region>(num1);
for (int num2 = 1; num2 < num1; num2++)
{
Region tmp = new Region(obj1.GetIndex(num2.ToString()));
if (tmp.Name != null )list1.Add(tmp);
}
list2 = list1;
return list2;
}
However even tho this seem to work it once in a while return illigal objects that when I try to assign them generate a "Heck No" Errormessage.
I also sent an email to Lax before.
/Me