diff options
author | Melanie Thielker | 2008-09-08 23:13:59 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-09-08 23:13:59 +0000 |
commit | 6ca7afabca74d80a2a260cb2c79a6a1f964af961 (patch) | |
tree | 5adfe5146c521be81eccd4aedba84816c23e47f8 /OpenSim | |
parent | Correct state handling and state event masks. Prims will now show (diff) | |
download | opensim-SC-6ca7afabca74d80a2a260cb2c79a6a1f964af961.zip opensim-SC-6ca7afabca74d80a2a260cb2c79a6a1f964af961.tar.gz opensim-SC-6ca7afabca74d80a2a260cb2c79a6a1f964af961.tar.bz2 opensim-SC-6ca7afabca74d80a2a260cb2c79a6a1f964af961.tar.xz |
Remove casting nastiness in LSL_Api
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 152 |
2 files changed, 80 insertions, 76 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index 2beb9bb..26e924f 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs | |||
@@ -329,6 +329,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
329 | /// </param> | 329 | /// </param> |
330 | protected void AddInventoryItem(string name, TaskInventoryItem item) | 330 | protected void AddInventoryItem(string name, TaskInventoryItem item) |
331 | { | 331 | { |
332 | name = FindAvailableInventoryName(name); | ||
333 | if (name == String.Empty) | ||
334 | return; | ||
335 | |||
332 | item.ParentID = UUID; | 336 | item.ParentID = UUID; |
333 | item.ParentPartID = UUID; | 337 | item.ParentPartID = UUID; |
334 | 338 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1f52dc3..58f5024 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -5550,7 +5550,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5550 | 5550 | ||
5551 | while (idx < rules.Length) | 5551 | while (idx < rules.Length) |
5552 | { | 5552 | { |
5553 | int code = Convert.ToInt32(rules.Data[idx++].ToString()); | 5553 | int code = rules.GetLSLIntegerItem(idx++); |
5554 | 5554 | ||
5555 | int remain = rules.Length - idx; | 5555 | int remain = rules.Length - idx; |
5556 | 5556 | ||
@@ -5563,7 +5563,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5563 | if (remain < 1) | 5563 | if (remain < 1) |
5564 | return; | 5564 | return; |
5565 | 5565 | ||
5566 | v=new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5566 | v=rules.GetVector3Item(idx++); |
5567 | SetPos(part, v); | 5567 | SetPos(part, v); |
5568 | 5568 | ||
5569 | break; | 5569 | break; |
@@ -5571,7 +5571,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5571 | if (remain < 1) | 5571 | if (remain < 1) |
5572 | return; | 5572 | return; |
5573 | 5573 | ||
5574 | v=new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5574 | v=rules.GetVector3Item(idx++); |
5575 | SetScale(part, v); | 5575 | SetScale(part, v); |
5576 | 5576 | ||
5577 | break; | 5577 | break; |
@@ -5579,7 +5579,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5579 | if (remain < 1) | 5579 | if (remain < 1) |
5580 | return; | 5580 | return; |
5581 | 5581 | ||
5582 | LSL_Types.Quaternion q = new LSL_Types.Quaternion(rules.Data[idx++].ToString()); | 5582 | LSL_Types.Quaternion q = rules.GetQuaternionItem(idx++); |
5583 | SetRot(part, q); | 5583 | SetRot(part, q); |
5584 | 5584 | ||
5585 | break; | 5585 | break; |
@@ -5588,7 +5588,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5588 | if (remain < 3) | 5588 | if (remain < 3) |
5589 | return; | 5589 | return; |
5590 | 5590 | ||
5591 | code = Convert.ToInt32(rules.Data[idx++].ToString()); | 5591 | code = (int)rules.GetLSLIntegerItem(idx++); |
5592 | 5592 | ||
5593 | remain = rules.Length - idx; | 5593 | remain = rules.Length - idx; |
5594 | float hollow; | 5594 | float hollow; |
@@ -5622,12 +5622,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5622 | if (remain < 6) | 5622 | if (remain < 6) |
5623 | return; | 5623 | return; |
5624 | 5624 | ||
5625 | face = Convert.ToInt32(rules.Data[idx++].ToString()); // holeshape | 5625 | face = (int)rules.GetLSLIntegerItem(idx++); // holeshape |
5626 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // cut | 5626 | v = rules.GetVector3Item(idx++); // cut |
5627 | hollow = (float)Convert.ToDouble(rules.Data[idx++].ToString()); | 5627 | hollow = (float)rules.GetLSLFloatItem(idx++); |
5628 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5628 | twist = rules.GetVector3Item(idx++); |
5629 | taper_b = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5629 | taper_b = rules.GetVector3Item(idx++); |
5630 | topshear = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5630 | topshear = rules.GetVector3Item(idx++); |
5631 | part.Shape.ProfileShape = ProfileShape.Circle; | 5631 | part.Shape.ProfileShape = ProfileShape.Circle; |
5632 | part.Shape.PathCurve = (byte)Extrusion.Straight; | 5632 | part.Shape.PathCurve = (byte)Extrusion.Straight; |
5633 | SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear, 0); | 5633 | SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear, 0); |
@@ -5637,12 +5637,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5637 | if (remain < 6) | 5637 | if (remain < 6) |
5638 | return; | 5638 | return; |
5639 | 5639 | ||
5640 | face = Convert.ToInt32(rules.Data[idx++].ToString()); // holeshape | 5640 | face = (int)rules.GetLSLIntegerItem(idx++); // holeshape |
5641 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5641 | v = rules.GetVector3Item(idx++); //cut |
5642 | hollow = (float)Convert.ToDouble(rules.Data[idx++].ToString()); | 5642 | hollow = (float)rules.GetLSLFloatItem(idx++); |
5643 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5643 | twist = rules.GetVector3Item(idx++); |
5644 | taper_b = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5644 | taper_b = rules.GetVector3Item(idx++); |
5645 | topshear = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5645 | topshear = rules.GetVector3Item(idx++); |
5646 | part.Shape.PathCurve = (byte)Extrusion.Straight; | 5646 | part.Shape.PathCurve = (byte)Extrusion.Straight; |
5647 | SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear, 3); | 5647 | SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear, 3); |
5648 | break; | 5648 | break; |
@@ -5651,11 +5651,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5651 | if (remain < 5) | 5651 | if (remain < 5) |
5652 | return; | 5652 | return; |
5653 | 5653 | ||
5654 | face = Convert.ToInt32(rules.Data[idx++].ToString()); // holeshape | 5654 | face = (int)rules.GetLSLIntegerItem(idx++); // holeshape |
5655 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // cut | 5655 | v = rules.GetVector3Item(idx++); // cut |
5656 | hollow = (float)Convert.ToDouble(rules.Data[idx++].ToString()); | 5656 | hollow = (float)rules.GetLSLFloatItem(idx++); |
5657 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5657 | twist = rules.GetVector3Item(idx++); |
5658 | taper_b = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // dimple | 5658 | taper_b = rules.GetVector3Item(idx++); // dimple |
5659 | part.Shape.PathCurve = (byte)Extrusion.Curve1; | 5659 | part.Shape.PathCurve = (byte)Extrusion.Curve1; |
5660 | SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, 5); | 5660 | SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, 5); |
5661 | break; | 5661 | break; |
@@ -5664,17 +5664,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5664 | if (remain < 11) | 5664 | if (remain < 11) |
5665 | return; | 5665 | return; |
5666 | 5666 | ||
5667 | face = Convert.ToInt32(rules.Data[idx++].ToString()); // holeshape | 5667 | face = (int)rules.GetLSLIntegerItem(idx++); // holeshape |
5668 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5668 | v = rules.GetVector3Item(idx++); //cut |
5669 | hollow = (float)Convert.ToDouble(rules.Data[idx++].ToString()); | 5669 | hollow = (float)rules.GetLSLFloatItem(idx++); |
5670 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5670 | twist = rules.GetVector3Item(idx++); |
5671 | holesize = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5671 | holesize = rules.GetVector3Item(idx++); |
5672 | topshear = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5672 | topshear = rules.GetVector3Item(idx++); |
5673 | profilecut = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5673 | profilecut = rules.GetVector3Item(idx++); |
5674 | taper_b = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // taper_a | 5674 | taper_b = rules.GetVector3Item(idx++); // taper_a |
5675 | revolutions = (float)Convert.ToDouble(rules.Data[idx++].ToString()); | 5675 | revolutions = (float)rules.GetLSLFloatItem(idx++); |
5676 | radiusoffset = (float)Convert.ToDouble(rules.Data[idx++].ToString()); | 5676 | radiusoffset = (float)rules.GetLSLFloatItem(idx++); |
5677 | skew = (float)Convert.ToDouble(rules.Data[idx++].ToString()); | 5677 | skew = (float)rules.GetLSLFloatItem(idx++); |
5678 | part.Shape.PathCurve = (byte)Extrusion.Curve1; | 5678 | part.Shape.PathCurve = (byte)Extrusion.Curve1; |
5679 | SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); | 5679 | SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); |
5680 | break; | 5680 | break; |
@@ -5683,17 +5683,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5683 | if (remain < 11) | 5683 | if (remain < 11) |
5684 | return; | 5684 | return; |
5685 | 5685 | ||
5686 | face = Convert.ToInt32(rules.Data[idx++].ToString()); // holeshape | 5686 | face = (int)rules.GetLSLIntegerItem(idx++); // holeshape |
5687 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5687 | v = rules.GetVector3Item(idx++); //cut |
5688 | hollow = (float)Convert.ToDouble(rules.Data[idx++].ToString()); | 5688 | hollow = (float)rules.GetLSLFloatItem(idx++); |
5689 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5689 | twist = rules.GetVector3Item(idx++); |
5690 | holesize = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5690 | holesize = rules.GetVector3Item(idx++); |
5691 | topshear = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5691 | topshear = rules.GetVector3Item(idx++); |
5692 | profilecut = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5692 | profilecut = rules.GetVector3Item(idx++); |
5693 | taper_b = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // taper_a | 5693 | taper_b = rules.GetVector3Item(idx++); // taper_a |
5694 | revolutions = (float)Convert.ToDouble(rules.Data[idx++].ToString()); | 5694 | revolutions = (float)rules.GetLSLFloatItem(idx++); |
5695 | radiusoffset = (float)Convert.ToDouble(rules.Data[idx++].ToString()); | 5695 | radiusoffset = (float)rules.GetLSLFloatItem(idx++); |
5696 | skew = (float)Convert.ToDouble(rules.Data[idx++].ToString()); | 5696 | skew = (float)rules.GetLSLFloatItem(idx++); |
5697 | part.Shape.PathCurve = (byte)Extrusion.Curve1; | 5697 | part.Shape.PathCurve = (byte)Extrusion.Curve1; |
5698 | SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); | 5698 | SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); |
5699 | break; | 5699 | break; |
@@ -5702,17 +5702,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5702 | if (remain < 11) | 5702 | if (remain < 11) |
5703 | return; | 5703 | return; |
5704 | 5704 | ||
5705 | face = Convert.ToInt32(rules.Data[idx++].ToString()); // holeshape | 5705 | face = (int)rules.GetLSLIntegerItem(idx++); // holeshape |
5706 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5706 | v = rules.GetVector3Item(idx++); //cut |
5707 | hollow = (float)Convert.ToDouble(rules.Data[idx++].ToString()); | 5707 | hollow = (float)rules.GetLSLFloatItem(idx++); |
5708 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5708 | twist = rules.GetVector3Item(idx++); |
5709 | holesize = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5709 | holesize = rules.GetVector3Item(idx++); |
5710 | topshear = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5710 | topshear = rules.GetVector3Item(idx++); |
5711 | profilecut = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5711 | profilecut = rules.GetVector3Item(idx++); |
5712 | taper_b = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // taper_a | 5712 | taper_b = rules.GetVector3Item(idx++); // taper_a |
5713 | revolutions = (float)Convert.ToDouble(rules.Data[idx++].ToString()); | 5713 | revolutions = (float)rules.GetLSLFloatItem(idx++); |
5714 | radiusoffset = (float)Convert.ToDouble(rules.Data[idx++].ToString()); | 5714 | radiusoffset = (float)rules.GetLSLFloatItem(idx++); |
5715 | skew = (float)Convert.ToDouble(rules.Data[idx++].ToString()); | 5715 | skew = (float)rules.GetLSLFloatItem(idx++); |
5716 | part.Shape.PathCurve = (byte)Extrusion.Curve1; | 5716 | part.Shape.PathCurve = (byte)Extrusion.Curve1; |
5717 | SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); | 5717 | SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); |
5718 | break; | 5718 | break; |
@@ -5722,7 +5722,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5722 | return; | 5722 | return; |
5723 | 5723 | ||
5724 | string map = rules.Data[idx++].ToString(); | 5724 | string map = rules.Data[idx++].ToString(); |
5725 | face = Convert.ToInt32(rules.Data[idx++].ToString()); // type | 5725 | face = (int)rules.GetLSLIntegerItem(idx++); // type |
5726 | part.Shape.PathCurve = (byte)Extrusion.Curve1; | 5726 | part.Shape.PathCurve = (byte)Extrusion.Curve1; |
5727 | SetPrimitiveShapeParams(part, map, face); | 5727 | SetPrimitiveShapeParams(part, map, face); |
5728 | break; | 5728 | break; |
@@ -5734,11 +5734,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5734 | if (remain < 5) | 5734 | if (remain < 5) |
5735 | return; | 5735 | return; |
5736 | 5736 | ||
5737 | face=Convert.ToInt32(rules.Data[idx++].ToString()); | 5737 | face=(int)rules.GetLSLIntegerItem(idx++); |
5738 | string tex=rules.Data[idx++].ToString(); | 5738 | string tex=rules.Data[idx++].ToString(); |
5739 | LSL_Types.Vector3 repeats=new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5739 | LSL_Types.Vector3 repeats=rules.GetVector3Item(idx++); |
5740 | LSL_Types.Vector3 offsets=new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5740 | LSL_Types.Vector3 offsets=rules.GetVector3Item(idx++); |
5741 | double rotation=Convert.ToDouble(rules.Data[idx++].ToString()); | 5741 | double rotation=(double)rules.GetLSLFloatItem(idx++); |
5742 | 5742 | ||
5743 | SetTexture(part, tex, face); | 5743 | SetTexture(part, tex, face); |
5744 | ScaleTexture(part, repeats.x, repeats.y, face); | 5744 | ScaleTexture(part, repeats.x, repeats.y, face); |
@@ -5751,9 +5751,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5751 | if (remain < 3) | 5751 | if (remain < 3) |
5752 | return; | 5752 | return; |
5753 | 5753 | ||
5754 | face=Convert.ToInt32(rules.Data[idx++].ToString()); | 5754 | face=(int)rules.GetLSLIntegerItem(idx++); |
5755 | LSL_Types.Vector3 color=new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5755 | LSL_Types.Vector3 color=rules.GetVector3Item(idx++); |
5756 | double alpha=Convert.ToDouble(rules.Data[idx++].ToString()); | 5756 | double alpha=(double)rules.GetLSLFloatItem(idx++); |
5757 | 5757 | ||
5758 | SetColor(part, color, face); | 5758 | SetColor(part, color, face); |
5759 | SetAlpha(part, alpha, face); | 5759 | SetAlpha(part, alpha, face); |
@@ -5793,7 +5793,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5793 | // as a raw CLI Int32. When / if this is inserted as an | 5793 | // as a raw CLI Int32. When / if this is inserted as an |
5794 | // LSL_Types.LSLInteger extract value using LSL_Types.list.GetLSLIntegerItem | 5794 | // LSL_Types.LSLInteger extract value using LSL_Types.list.GetLSLIntegerItem |
5795 | // face = rules.GetLSLIntegerItem(idx++); | 5795 | // face = rules.GetLSLIntegerItem(idx++); |
5796 | face = Convert.ToInt32(rules.Data[idx++].ToString()); | 5796 | face = (int)rules.GetLSLIntegerItem(idx++); |
5797 | float glow = (float)rules.GetLSLFloatItem(idx++); | 5797 | float glow = (float)rules.GetLSLFloatItem(idx++); |
5798 | 5798 | ||
5799 | SetGlow(part, face, glow); | 5799 | SetGlow(part, face, glow); |
@@ -5802,9 +5802,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5802 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: | 5802 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: |
5803 | if (remain < 3) | 5803 | if (remain < 3) |
5804 | return; | 5804 | return; |
5805 | face = Convert.ToInt32(rules.Data[idx++].ToString()); | 5805 | face = (int)rules.GetLSLIntegerItem(idx++); |
5806 | int shiny = Convert.ToInt32(rules.Data[idx++].ToString()); | 5806 | int shiny = (int)rules.GetLSLIntegerItem(idx++); |
5807 | Bumpiness bump = (Bumpiness)Convert.ToByte(rules.Data[idx++].ToString()); | 5807 | Bumpiness bump = (Bumpiness)Convert.ToByte((int)rules.GetLSLIntegerItem(idx++)); |
5808 | 5808 | ||
5809 | SetShiny(part, face, shiny, bump); | 5809 | SetShiny(part, face, shiny, bump); |
5810 | 5810 | ||
@@ -5816,7 +5816,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5816 | // as a raw CLI Int32. When / if this is inserted as an | 5816 | // as a raw CLI Int32. When / if this is inserted as an |
5817 | // LSL_Types.LSLInteger extract value using LSL_Types.list.GetLSLIntegerItem | 5817 | // LSL_Types.LSLInteger extract value using LSL_Types.list.GetLSLIntegerItem |
5818 | // face = rules.GetLSLIntegerItem(idx++); | 5818 | // face = rules.GetLSLIntegerItem(idx++); |
5819 | face = Convert.ToInt32(rules.Data[idx++].ToString()); | 5819 | face = (int)rules.GetLSLIntegerItem(idx++); |
5820 | bool st = rules.GetLSLIntegerItem(idx++); | 5820 | bool st = rules.GetLSLIntegerItem(idx++); |
5821 | SetFullBright(part, face , st); | 5821 | SetFullBright(part, face , st); |
5822 | break; | 5822 | break; |
@@ -5827,7 +5827,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5827 | { | 5827 | { |
5828 | /* Unhandled at this time - sends "Unhandled" message | 5828 | /* Unhandled at this time - sends "Unhandled" message |
5829 | will enable when available | 5829 | will enable when available |
5830 | byte material = (byte)Convert.ToByte( rules.Data[idx++].ToString()); | 5830 | byte material = Convert.ToByte((int)rules.GetLSLIntegerItem(idx++)); |
5831 | part.Material = material; | 5831 | part.Material = material; |
5832 | */ | 5832 | */ |
5833 | return; | 5833 | return; |
@@ -6115,7 +6115,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6115 | int idx=0; | 6115 | int idx=0; |
6116 | while (idx < rules.Length) | 6116 | while (idx < rules.Length) |
6117 | { | 6117 | { |
6118 | int code=Convert.ToInt32(rules.Data[idx++].ToString()); | 6118 | int code=(int)rules.GetLSLIntegerItem(idx++); |
6119 | int remain=rules.Length-idx; | 6119 | int remain=rules.Length-idx; |
6120 | 6120 | ||
6121 | switch (code) | 6121 | switch (code) |
@@ -6240,7 +6240,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6240 | if (remain < 1) | 6240 | if (remain < 1) |
6241 | return res; | 6241 | return res; |
6242 | 6242 | ||
6243 | int face = Convert.ToInt32(rules.Data[idx++].ToString()); | 6243 | int face = (int)rules.GetLSLIntegerItem(idx++); |
6244 | if (face == -1) | 6244 | if (face == -1) |
6245 | face = 0; | 6245 | face = 0; |
6246 | 6246 | ||
@@ -6261,7 +6261,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6261 | if (remain < 1) | 6261 | if (remain < 1) |
6262 | return res; | 6262 | return res; |
6263 | 6263 | ||
6264 | face=Convert.ToInt32(rules.Data[idx++].ToString()); | 6264 | face=(int)rules.GetLSLIntegerItem(idx++); |
6265 | 6265 | ||
6266 | tex = m_host.Shape.Textures; | 6266 | tex = m_host.Shape.Textures; |
6267 | Color4 texcolor; | 6267 | Color4 texcolor; |
@@ -6280,7 +6280,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6280 | if (remain < 1) | 6280 | if (remain < 1) |
6281 | return res; | 6281 | return res; |
6282 | 6282 | ||
6283 | face=Convert.ToInt32(rules.Data[idx++].ToString()); | 6283 | face=(int)rules.GetLSLIntegerItem(idx++); |
6284 | 6284 | ||
6285 | res.Add(new LSL_Types.LSLInteger(0)); | 6285 | res.Add(new LSL_Types.LSLInteger(0)); |
6286 | res.Add(new LSL_Types.LSLInteger(0)); | 6286 | res.Add(new LSL_Types.LSLInteger(0)); |
@@ -6291,7 +6291,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6291 | if (remain < 1) | 6291 | if (remain < 1) |
6292 | return res; | 6292 | return res; |
6293 | 6293 | ||
6294 | face=Convert.ToInt32(rules.Data[idx++].ToString()); | 6294 | face=(int)rules.GetLSLIntegerItem(idx++); |
6295 | 6295 | ||
6296 | res.Add(new LSL_Types.LSLInteger(0)); | 6296 | res.Add(new LSL_Types.LSLInteger(0)); |
6297 | break; | 6297 | break; |
@@ -6319,7 +6319,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6319 | if (remain < 1) | 6319 | if (remain < 1) |
6320 | return res; | 6320 | return res; |
6321 | 6321 | ||
6322 | face=Convert.ToInt32(rules.Data[idx++].ToString()); | 6322 | face=(int)rules.GetLSLIntegerItem(idx++); |
6323 | 6323 | ||
6324 | res.Add(new LSL_Types.LSLInteger(0)); | 6324 | res.Add(new LSL_Types.LSLInteger(0)); |
6325 | break; | 6325 | break; |
@@ -6344,7 +6344,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6344 | if (remain < 1) | 6344 | if (remain < 1) |
6345 | return res; | 6345 | return res; |
6346 | 6346 | ||
6347 | face=Convert.ToInt32(rules.Data[idx++].ToString()); | 6347 | face=(int)rules.GetLSLIntegerItem(idx++); |
6348 | 6348 | ||
6349 | res.Add(new LSL_Types.LSLFloat(0)); | 6349 | res.Add(new LSL_Types.LSLFloat(0)); |
6350 | break; | 6350 | break; |