Streamline PRIM_LINK_TARGET, eliminating a recursion and a failure scenario

remove-scene-viewer
Melanie 2011-11-02 11:43:16 +00:00
parent 7c8bfac11b
commit b9e700b60d
1 changed files with 3 additions and 4 deletions

View File

@ -7411,12 +7411,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
TargetOmega(part, axis, (double)spinrate, (double)gain); TargetOmega(part, axis, (double)spinrate, (double)gain);
break; break;
case (int)ScriptBaseClass.PRIM_LINK_TARGET: case (int)ScriptBaseClass.PRIM_LINK_TARGET:
if (remain < 3) // setting to 3 on the basis that parsing any usage of PRIM_LINK_TARGET that has nothing following it is pointless. if (remain < 1)
return; return;
LSL_Integer new_linknumber = rules.GetLSLIntegerItem(idx++); LSL_Integer new_linknumber = rules.GetLSLIntegerItem(idx++);
LSL_List new_rules = rules.GetSublist(idx, -1); part = part.ParentGroup.GetLinkNumPart((int)new_linknumber);
setLinkPrimParams((int)new_linknumber, new_rules); break;
return;
} }
} }
} }