mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 05:45:37 +08:00
reduce potencial useless int casts from list items
This commit is contained in:
@@ -6946,7 +6946,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
int psystype;
|
||||
try
|
||||
{
|
||||
psystype = rules.GetLSLIntegerItem(i);
|
||||
psystype = rules.GetIntegerItem(i);
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
@@ -6958,7 +6958,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
case ScriptBaseClass.PSYS_PART_FLAGS:
|
||||
try
|
||||
{
|
||||
prules.PartDataFlags = (Primitive.ParticleSystem.ParticleDataFlags)(uint)rules.GetLSLIntegerItem(i + 1);
|
||||
prules.PartDataFlags = (Primitive.ParticleSystem.ParticleDataFlags)(uint)rules.GetIntegerItem(i + 1);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -7082,7 +7082,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
case ScriptBaseClass.PSYS_SRC_PATTERN:
|
||||
try
|
||||
{
|
||||
tmpi = (int)rules.GetLSLIntegerItem(i + 1);
|
||||
tmpi = rules.GetIntegerItem(i + 1);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -7127,7 +7127,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
case ScriptBaseClass.PSYS_PART_BLEND_FUNC_SOURCE:
|
||||
try
|
||||
{
|
||||
tmpi = (int)rules.GetLSLIntegerItem(i + 1);
|
||||
tmpi = rules.GetIntegerItem(i + 1);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -7140,7 +7140,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
case ScriptBaseClass.PSYS_PART_BLEND_FUNC_DEST:
|
||||
try
|
||||
{
|
||||
tmpi = (int)rules.GetLSLIntegerItem(i + 1);
|
||||
tmpi = rules.GetIntegerItem(i + 1);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -7204,7 +7204,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
case ScriptBaseClass.PSYS_SRC_BURST_PART_COUNT:
|
||||
try
|
||||
{
|
||||
prules.BurstPartCount = (byte)(int)rules.GetLSLIntegerItem(i + 1);
|
||||
prules.BurstPartCount = (byte)rules.GetIntegerItem(i + 1);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -8360,7 +8360,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
while (remaining.Length > 2)
|
||||
{
|
||||
linknumber = remaining.GetLSLIntegerItem(0);
|
||||
linknumber = remaining.GetIntegerItem(0);
|
||||
rules = remaining.GetSublist(1, -1);
|
||||
parts.Clear();
|
||||
prims = GetLinkParts(linknumber);
|
||||
@@ -8403,7 +8403,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
while (idx < options.Data.Length)
|
||||
{
|
||||
int option = (int)options.GetLSLIntegerItem(idx++);
|
||||
int option = options.GetIntegerItem(idx++);
|
||||
int remain = options.Data.Length - idx;
|
||||
|
||||
switch (option)
|
||||
@@ -8411,7 +8411,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
case ScriptBaseClass.KFM_MODE:
|
||||
if (remain < 1)
|
||||
break;
|
||||
int modeval = (int)options.GetLSLIntegerItem(idx++);
|
||||
int modeval = options.GetIntegerItem(idx++);
|
||||
switch(modeval)
|
||||
{
|
||||
case ScriptBaseClass.KFM_FORWARD:
|
||||
@@ -8431,7 +8431,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
case ScriptBaseClass.KFM_DATA:
|
||||
if (remain < 1)
|
||||
break;
|
||||
int dataval = (int)options.GetLSLIntegerItem(idx++);
|
||||
int dataval = options.GetIntegerItem(idx++);
|
||||
data = (KeyframeMotion.DataFormat)dataval;
|
||||
break;
|
||||
}
|
||||
@@ -8497,12 +8497,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
while (idx < options.Data.Length)
|
||||
{
|
||||
int option = (int)options.GetLSLIntegerItem(idx++);
|
||||
int option = options.GetIntegerItem(idx++);
|
||||
|
||||
switch (option)
|
||||
{
|
||||
case ScriptBaseClass.KFM_COMMAND:
|
||||
int cmd = (int)options.GetLSLIntegerItem(idx++);
|
||||
int cmd = options.GetIntegerItem(idx++);
|
||||
switch (cmd)
|
||||
{
|
||||
case ScriptBaseClass.KFM_CMD_PLAY:
|
||||
@@ -8605,7 +8605,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
while (idx < rules.Length)
|
||||
{
|
||||
++rulesParsed;
|
||||
int code = rules.GetLSLIntegerItem(idx++);
|
||||
int code = rules.GetIntegerItem(idx++);
|
||||
|
||||
int remain = rules.Length - idx;
|
||||
idxStart = idx;
|
||||
@@ -8681,7 +8681,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
code = (int)rules.GetLSLIntegerItem(idx++);
|
||||
code = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -8708,7 +8708,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
face = (int)rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -8771,7 +8771,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
|
||||
face = rules.GetIntegerItem(idx++); // holeshape
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -8833,7 +8833,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
|
||||
face = rules.GetIntegerItem(idx++); // holeshape
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -8895,7 +8895,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
|
||||
face = rules.GetIntegerItem(idx++); // holeshape
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -8948,7 +8948,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
|
||||
face = rules.GetIntegerItem(idx++); // holeshape
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9055,7 +9055,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
|
||||
face = rules.GetIntegerItem(idx++); // holeshape
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9162,7 +9162,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
|
||||
face = rules.GetIntegerItem(idx++); // holeshape
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9270,7 +9270,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
string map = rules.Data[idx++].ToString();
|
||||
try
|
||||
{
|
||||
face = (int)rules.GetLSLIntegerItem(idx++); // type
|
||||
face = rules.GetIntegerItem(idx++); // type
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9287,7 +9287,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (remain < 5)
|
||||
return new LSL_List();
|
||||
|
||||
face=(int)rules.GetLSLIntegerItem(idx++);
|
||||
face=rules.GetIntegerItem(idx++);
|
||||
string tex;
|
||||
LSL_Vector repeats;
|
||||
LSL_Vector offsets;
|
||||
@@ -9334,7 +9334,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
face = (int)rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9377,7 +9377,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
flexi = rules.GetLSLIntegerItem(idx++);
|
||||
flexi = rules.GetIntegerItem(idx++) != 0;
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9386,7 +9386,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
try
|
||||
{
|
||||
softness = rules.GetLSLIntegerItem(idx++);
|
||||
softness = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9454,7 +9454,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
light = rules.GetLSLIntegerItem(idx++);
|
||||
light = rules.GetIntegerItem(idx++) != 0;
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9510,7 +9510,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
face = rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9540,7 +9540,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
face = (int)rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9549,7 +9549,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
try
|
||||
{
|
||||
shiny = (int)rules.GetLSLIntegerItem(idx++);
|
||||
shiny = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9558,7 +9558,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
try
|
||||
{
|
||||
bump = (Bumpiness)(int)rules.GetLSLIntegerItem(idx++);
|
||||
bump = (Bumpiness)rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9577,7 +9577,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
face = rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9586,7 +9586,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
try
|
||||
{
|
||||
st = rules.GetLSLIntegerItem(idx++);
|
||||
st = rules.GetIntegerItem(idx++) != 0;
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9603,7 +9603,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
mat = rules.GetLSLIntegerItem(idx++);
|
||||
mat = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9640,7 +9640,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
shape_type = rules.GetLSLIntegerItem(idx++);
|
||||
shape_type = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9664,7 +9664,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (remain < 5)
|
||||
return new LSL_List();
|
||||
|
||||
int material_bits = rules.GetLSLIntegerItem(idx++);
|
||||
int material_bits = rules.GetIntegerItem(idx++);
|
||||
float material_density = (float)rules.GetLSLFloatItem(idx++);
|
||||
float material_friction = (float)rules.GetLSLFloatItem(idx++);
|
||||
float material_restitution = (float)rules.GetLSLFloatItem(idx++);
|
||||
@@ -9691,7 +9691,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
face = rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9700,7 +9700,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
try
|
||||
{
|
||||
style = rules.GetLSLIntegerItem(idx++);
|
||||
style = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9852,7 +9852,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
int active;
|
||||
try
|
||||
{
|
||||
active = rules.GetLSLIntegerItem(idx++);
|
||||
active = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9898,7 +9898,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
face = rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9909,7 +9909,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
int materialAlphaMode;
|
||||
try
|
||||
{
|
||||
materialAlphaMode = rules.GetLSLIntegerItem(idx++);
|
||||
materialAlphaMode = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9926,7 +9926,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
int materialMaskCutoff;
|
||||
try
|
||||
{
|
||||
materialMaskCutoff = rules.GetLSLIntegerItem(idx++);
|
||||
materialMaskCutoff = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -9949,7 +9949,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
face = rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -10018,7 +10018,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
try
|
||||
{
|
||||
face = rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -10087,7 +10087,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
LSL_Integer msgloss;
|
||||
try
|
||||
{
|
||||
msgloss = rules.GetLSLIntegerItem(idx++);
|
||||
msgloss = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -10098,7 +10098,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
LSL_Integer msenv;
|
||||
try
|
||||
{
|
||||
msenv = rules.GetLSLIntegerItem(idx++);
|
||||
msenv = rules.GetIntegerItem(idx++);
|
||||
}
|
||||
catch(InvalidCastException)
|
||||
{
|
||||
@@ -10440,7 +10440,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
while (idx < rules.Length)
|
||||
{
|
||||
++rulesParsed;
|
||||
int code = rules.GetLSLIntegerItem(idx++);
|
||||
int code = rules.GetIntegerItem(idx++);
|
||||
|
||||
int remain = rules.Length - idx;
|
||||
idxStart = idx;
|
||||
@@ -10826,7 +10826,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
while (remaining is not null && remaining.Length > 1)
|
||||
{
|
||||
int linknumber = remaining.GetLSLIntegerItem(0);
|
||||
int linknumber = remaining.GetIntegerItem(0);
|
||||
rules = remaining.GetSublist(1, -1);
|
||||
List<SceneObjectPart> parts = GetLinkParts(linknumber);
|
||||
if(parts.Count == 0)
|
||||
@@ -10867,7 +10867,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
if (remaining.Length > 0)
|
||||
{
|
||||
linknumber = remaining.GetLSLIntegerItem(0);
|
||||
linknumber = remaining.GetIntegerItem(0);
|
||||
rules = remaining.GetSublist(1, -1);
|
||||
}
|
||||
else
|
||||
@@ -10886,7 +10886,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
while (idx < rules.Length)
|
||||
{
|
||||
int code = (int)rules.GetLSLIntegerItem(idx++);
|
||||
int code = rules.GetIntegerItem(idx++);
|
||||
int remain = rules.Length - idx;
|
||||
|
||||
switch (code)
|
||||
@@ -11022,7 +11022,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (remain < 1)
|
||||
return new LSL_List();
|
||||
|
||||
face = (int)rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
tex = part.Shape.Textures;
|
||||
|
||||
if (face == ScriptBaseClass.ALL_SIDES)
|
||||
@@ -11063,7 +11063,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (remain < 1)
|
||||
return new LSL_List();
|
||||
|
||||
face = (int)rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
tex = part.Shape.Textures;
|
||||
Color4 texcolor;
|
||||
|
||||
@@ -11093,7 +11093,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (remain < 1)
|
||||
return new LSL_List();
|
||||
|
||||
face = (int)rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
tex = part.Shape.Textures;
|
||||
int shiny;
|
||||
if (face == ScriptBaseClass.ALL_SIDES)
|
||||
@@ -11150,7 +11150,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (remain < 1)
|
||||
return new LSL_List();
|
||||
|
||||
face = (int)rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
|
||||
tex = part.Shape.Textures;
|
||||
int fullbright;
|
||||
@@ -11208,7 +11208,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (remain < 1)
|
||||
return new LSL_List();
|
||||
|
||||
face = (int)rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
|
||||
tex = part.Shape.Textures;
|
||||
if (face == ScriptBaseClass.ALL_SIDES)
|
||||
@@ -11257,7 +11257,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (remain < 1)
|
||||
return new LSL_List();
|
||||
|
||||
face = (int)rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
|
||||
tex = part.Shape.Textures;
|
||||
float primglow;
|
||||
@@ -11351,7 +11351,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (remain < 1)
|
||||
return new LSL_List();
|
||||
|
||||
face = (int)rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
tex = part.Shape.Textures;
|
||||
if (face == ScriptBaseClass.ALL_SIDES)
|
||||
{
|
||||
@@ -11526,7 +11526,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
for (int i = 0; i < rules.Length; i++)
|
||||
{
|
||||
int code = (int)rules.GetLSLIntegerItem(i);
|
||||
int code = rules.GetIntegerItem(i);
|
||||
|
||||
switch (code)
|
||||
{
|
||||
@@ -11649,16 +11649,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
while (i < rules.Length - 1)
|
||||
{
|
||||
int code = rules.GetLSLIntegerItem(i++);
|
||||
int code = rules.GetIntegerItem(i++);
|
||||
|
||||
switch (code)
|
||||
{
|
||||
case ScriptBaseClass.PRIM_MEDIA_ALT_IMAGE_ENABLE:
|
||||
me.EnableAlterntiveImage = (rules.GetLSLIntegerItem(i++) != 0 ? true : false);
|
||||
me.EnableAlterntiveImage = rules.GetIntegerItem(i++) != 0;
|
||||
break;
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_CONTROLS:
|
||||
int v = rules.GetLSLIntegerItem(i++);
|
||||
int v = rules.GetIntegerItem(i++);
|
||||
if (ScriptBaseClass.PRIM_MEDIA_CONTROLS_STANDARD == v)
|
||||
me.Controls = MediaControls.Standard;
|
||||
else
|
||||
@@ -11674,35 +11674,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
break;
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_AUTO_LOOP:
|
||||
me.AutoLoop = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
|
||||
me.AutoLoop = rules.GetIntegerItem(i++) != 0;
|
||||
break;
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_AUTO_PLAY:
|
||||
me.AutoPlay = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
|
||||
me.AutoPlay = rules.GetIntegerItem(i++) != 0;
|
||||
break;
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_AUTO_SCALE:
|
||||
me.AutoScale = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
|
||||
me.AutoScale = rules.GetIntegerItem(i++) != 0;
|
||||
break;
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_AUTO_ZOOM:
|
||||
me.AutoZoom = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
|
||||
me.AutoZoom = rules.GetIntegerItem(i++) != 0;
|
||||
break;
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_FIRST_CLICK_INTERACT:
|
||||
me.InteractOnFirstClick = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
|
||||
me.InteractOnFirstClick = rules.GetIntegerItem(i++) != 0;
|
||||
break;
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_WIDTH_PIXELS:
|
||||
me.Width = (int)rules.GetLSLIntegerItem(i++);
|
||||
me.Width = rules.GetIntegerItem(i++);
|
||||
break;
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_HEIGHT_PIXELS:
|
||||
me.Height = (int)rules.GetLSLIntegerItem(i++);
|
||||
me.Height = rules.GetIntegerItem(i++);
|
||||
break;
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_WHITELIST_ENABLE:
|
||||
me.EnableWhiteList = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
|
||||
me.EnableWhiteList = rules.GetIntegerItem(i++) != 0;
|
||||
break;
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_WHITELIST:
|
||||
@@ -11714,11 +11714,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
break;
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_PERMS_INTERACT:
|
||||
me.InteractPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++);
|
||||
me.InteractPermissions = (MediaPermission)(byte)rules.GetIntegerItem(i++);
|
||||
break;
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL:
|
||||
me.ControlPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++);
|
||||
me.ControlPermissions = (MediaPermission)(byte)rules.GetIntegerItem(i++);
|
||||
break;
|
||||
|
||||
default: return ScriptBaseClass.LSL_STATUS_MALFORMED_PARAMS;
|
||||
@@ -13030,10 +13030,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
int[] nPrice = new int[5];
|
||||
nPrice[0] = price;
|
||||
nPrice[1] = quick_pay_buttons.GetLSLIntegerItem(0);
|
||||
nPrice[2] = quick_pay_buttons.GetLSLIntegerItem(1);
|
||||
nPrice[3] = quick_pay_buttons.GetLSLIntegerItem(2);
|
||||
nPrice[4] = quick_pay_buttons.GetLSLIntegerItem(3);
|
||||
nPrice[1] = quick_pay_buttons.GetIntegerItem(0);
|
||||
nPrice[2] = quick_pay_buttons.GetIntegerItem(1);
|
||||
nPrice[3] = quick_pay_buttons.GetIntegerItem(2);
|
||||
nPrice[4] = quick_pay_buttons.GetIntegerItem(3);
|
||||
m_host.ParentGroup.RootPart.PayPrice = nPrice;
|
||||
m_host.ParentGroup.HasGroupChanged = true;
|
||||
}
|
||||
@@ -14773,7 +14773,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
int linknumber;
|
||||
try
|
||||
{
|
||||
linknumber = remaining.GetLSLIntegerItem(0);
|
||||
linknumber = remaining.GetIntegerItem(0);
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
@@ -14822,7 +14822,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
int linknumber;
|
||||
try
|
||||
{
|
||||
linknumber = remaining.GetLSLIntegerItem(0);
|
||||
linknumber = remaining.GetIntegerItem(0);
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
@@ -15307,14 +15307,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
for (int i = 0; i < options.Length; i += 2)
|
||||
{
|
||||
if (options.GetLSLIntegerItem(i) == ScriptBaseClass.RC_MAX_HITS)
|
||||
count = options.GetLSLIntegerItem(i + 1);
|
||||
else if (options.GetLSLIntegerItem(i) == ScriptBaseClass.RC_DETECT_PHANTOM)
|
||||
detectPhantom = (options.GetLSLIntegerItem(i + 1) > 0);
|
||||
else if (options.GetLSLIntegerItem(i) == ScriptBaseClass.RC_DATA_FLAGS)
|
||||
dataFlags = options.GetLSLIntegerItem(i + 1);
|
||||
else if (options.GetLSLIntegerItem(i) == ScriptBaseClass.RC_REJECT_TYPES)
|
||||
rejectTypes = options.GetLSLIntegerItem(i + 1);
|
||||
if (options.GetIntegerItem(i) == ScriptBaseClass.RC_MAX_HITS)
|
||||
count = options.GetIntegerItem(i + 1);
|
||||
else if (options.GetIntegerItem(i) == ScriptBaseClass.RC_DETECT_PHANTOM)
|
||||
detectPhantom = (options.GetIntegerItem(i + 1) > 0);
|
||||
else if (options.GetIntegerItem(i) == ScriptBaseClass.RC_DATA_FLAGS)
|
||||
dataFlags = options.GetIntegerItem(i + 1);
|
||||
else if (options.GetIntegerItem(i) == ScriptBaseClass.RC_REJECT_TYPES)
|
||||
rejectTypes = options.GetIntegerItem(i + 1);
|
||||
}
|
||||
|
||||
if (count > 16)
|
||||
@@ -15570,14 +15570,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
bool notdetectPhantom = true;
|
||||
for (int i = 0; i < options.Length; i += 2)
|
||||
{
|
||||
if (options.GetLSLIntegerItem(i) == ScriptBaseClass.RC_REJECT_TYPES)
|
||||
rejectTypes = options.GetLSLIntegerItem(i + 1);
|
||||
else if (options.GetLSLIntegerItem(i) == ScriptBaseClass.RC_DATA_FLAGS)
|
||||
dataFlags = options.GetLSLIntegerItem(i + 1);
|
||||
else if (options.GetLSLIntegerItem(i) == ScriptBaseClass.RC_MAX_HITS)
|
||||
maxHits = options.GetLSLIntegerItem(i + 1);
|
||||
else if (options.GetLSLIntegerItem(i) == ScriptBaseClass.RC_DETECT_PHANTOM)
|
||||
notdetectPhantom = (options.GetLSLIntegerItem(i + 1) == 0);
|
||||
if (options.GetIntegerItem(i) == ScriptBaseClass.RC_REJECT_TYPES)
|
||||
rejectTypes = options.GetIntegerItem(i + 1);
|
||||
else if (options.GetIntegerItem(i) == ScriptBaseClass.RC_DATA_FLAGS)
|
||||
dataFlags = options.GetIntegerItem(i + 1);
|
||||
else if (options.GetIntegerItem(i) == ScriptBaseClass.RC_MAX_HITS)
|
||||
maxHits = options.GetIntegerItem(i + 1);
|
||||
else if (options.GetIntegerItem(i) == ScriptBaseClass.RC_DETECT_PHANTOM)
|
||||
notdetectPhantom = (options.GetIntegerItem(i + 1) == 0);
|
||||
}
|
||||
if (maxHits > m_maxHitsInCastRay)
|
||||
maxHits = m_maxHitsInCastRay;
|
||||
@@ -16664,7 +16664,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
while (idx < rules.Length)
|
||||
{
|
||||
++rulesParsed;
|
||||
int code = rules.GetLSLIntegerItem(idx++);
|
||||
int code = rules.GetIntegerItem(idx++);
|
||||
|
||||
int remain = rules.Length - idx;
|
||||
idxStart = idx;
|
||||
@@ -16743,7 +16743,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
case ScriptBaseClass.PRIM_TYPE:
|
||||
if (remain < 3)
|
||||
return new LSL_List();
|
||||
code = (int)rules.GetLSLIntegerItem(idx++);
|
||||
code = (int)rules.GetIntegerItem(idx++);
|
||||
remain = rules.Length - idx;
|
||||
switch (code)
|
||||
{
|
||||
@@ -16835,7 +16835,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
int idx = 0;
|
||||
while (idx < rules.Length)
|
||||
{
|
||||
int code = (int)rules.GetLSLIntegerItem(idx++);
|
||||
int code = rules.GetIntegerItem(idx++);
|
||||
int remain = rules.Length - idx;
|
||||
|
||||
switch (code)
|
||||
@@ -16902,7 +16902,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (remain < 1)
|
||||
return new LSL_List();
|
||||
|
||||
int face = (int)rules.GetLSLIntegerItem(idx++);
|
||||
int face = rules.GetIntegerItem(idx++);
|
||||
if (face == ScriptBaseClass.ALL_SIDES)
|
||||
{
|
||||
for (face = 0; face < 21; face++)
|
||||
@@ -16929,7 +16929,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (remain < 1)
|
||||
return new LSL_List();
|
||||
|
||||
face = (int)rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
|
||||
if (face == ScriptBaseClass.ALL_SIDES)
|
||||
{
|
||||
@@ -16949,7 +16949,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
case ScriptBaseClass.PRIM_BUMP_SHINY:
|
||||
if (remain < 1)
|
||||
return new LSL_List();
|
||||
face = (int)rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
|
||||
if (face == ScriptBaseClass.ALL_SIDES)
|
||||
{
|
||||
@@ -16969,7 +16969,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
case ScriptBaseClass.PRIM_FULLBRIGHT:
|
||||
if (remain < 1)
|
||||
return new LSL_List();
|
||||
face = (int)rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
|
||||
if (face == ScriptBaseClass.ALL_SIDES)
|
||||
{
|
||||
@@ -16998,7 +16998,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
// (PRIM_TEXGEN_DEFAULT, PRIM_TEXGEN_PLANAR)
|
||||
if (remain < 1)
|
||||
return new LSL_List();
|
||||
face = (int)rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
|
||||
if (face == ScriptBaseClass.ALL_SIDES)
|
||||
{
|
||||
@@ -17024,7 +17024,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
case ScriptBaseClass.PRIM_GLOW:
|
||||
if (remain < 1)
|
||||
return new LSL_List();
|
||||
face = (int)rules.GetLSLIntegerItem(idx++);
|
||||
face = rules.GetIntegerItem(idx++);
|
||||
|
||||
if (face == ScriptBaseClass.ALL_SIDES)
|
||||
{
|
||||
|
||||
@@ -116,132 +116,131 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
RegionLightShareData wl = m_environment.ToLightShare();
|
||||
|
||||
LSL_List values = new LSL_List();
|
||||
LSL_List values = new();
|
||||
int idx = 0;
|
||||
while (idx < rules.Length)
|
||||
{
|
||||
LSL_Integer ruleInt = rules.GetLSLIntegerItem(idx);
|
||||
uint rule = (uint)ruleInt;
|
||||
LSL_List toadd = new LSL_List();
|
||||
int rule = rules.GetIntegerItem(idx);
|
||||
LSL_List toadd = new();
|
||||
|
||||
switch (rule)
|
||||
{
|
||||
case (int)ScriptBaseClass.WL_AMBIENT:
|
||||
case ScriptBaseClass.WL_AMBIENT:
|
||||
toadd.Add(new LSL_Rotation(wl.ambient.X, wl.ambient.Y, wl.ambient.Z, wl.ambient.W));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_BIG_WAVE_DIRECTION:
|
||||
case ScriptBaseClass.WL_BIG_WAVE_DIRECTION:
|
||||
toadd.Add(new LSL_Vector(wl.bigWaveDirection.X, wl.bigWaveDirection.Y, 0.0f));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_BLUE_DENSITY:
|
||||
case ScriptBaseClass.WL_BLUE_DENSITY:
|
||||
toadd.Add(new LSL_Rotation(wl.blueDensity.X, wl.blueDensity.Y, wl.blueDensity.Z, wl.blueDensity.W));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_BLUR_MULTIPLIER:
|
||||
case ScriptBaseClass.WL_BLUR_MULTIPLIER:
|
||||
toadd.Add(new LSL_Float(wl.blurMultiplier));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_CLOUD_COLOR:
|
||||
case ScriptBaseClass.WL_CLOUD_COLOR:
|
||||
toadd.Add(new LSL_Rotation(wl.cloudColor.X, wl.cloudColor.Y, wl.cloudColor.Z, wl.cloudColor.W));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_CLOUD_COVERAGE:
|
||||
case ScriptBaseClass.WL_CLOUD_COVERAGE:
|
||||
toadd.Add(new LSL_Float(wl.cloudCoverage));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_CLOUD_DETAIL_XY_DENSITY:
|
||||
case ScriptBaseClass.WL_CLOUD_DETAIL_XY_DENSITY:
|
||||
toadd.Add(new LSL_Vector(wl.cloudDetailXYDensity.X, wl.cloudDetailXYDensity.Y, wl.cloudDetailXYDensity.Z));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_CLOUD_SCALE:
|
||||
case ScriptBaseClass.WL_CLOUD_SCALE:
|
||||
toadd.Add(new LSL_Float(wl.cloudScale));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_CLOUD_SCROLL_X:
|
||||
case ScriptBaseClass.WL_CLOUD_SCROLL_X:
|
||||
toadd.Add(new LSL_Float(wl.cloudScrollX));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_CLOUD_SCROLL_X_LOCK:
|
||||
case ScriptBaseClass.WL_CLOUD_SCROLL_X_LOCK:
|
||||
toadd.Add(new LSL_Integer(wl.cloudScrollXLock ? 1 : 0));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_CLOUD_SCROLL_Y:
|
||||
case ScriptBaseClass.WL_CLOUD_SCROLL_Y:
|
||||
toadd.Add(new LSL_Float(wl.cloudScrollY));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_CLOUD_SCROLL_Y_LOCK:
|
||||
case ScriptBaseClass.WL_CLOUD_SCROLL_Y_LOCK:
|
||||
toadd.Add(new LSL_Integer(wl.cloudScrollYLock ? 1 : 0));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_CLOUD_XY_DENSITY:
|
||||
case ScriptBaseClass.WL_CLOUD_XY_DENSITY:
|
||||
toadd.Add(new LSL_Vector(wl.cloudXYDensity.X, wl.cloudXYDensity.Y, wl.cloudXYDensity.Z));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_DENSITY_MULTIPLIER:
|
||||
case ScriptBaseClass.WL_DENSITY_MULTIPLIER:
|
||||
toadd.Add(new LSL_Float(wl.densityMultiplier));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_DISTANCE_MULTIPLIER:
|
||||
case ScriptBaseClass.WL_DISTANCE_MULTIPLIER:
|
||||
toadd.Add(new LSL_Float(wl.distanceMultiplier));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_DRAW_CLASSIC_CLOUDS:
|
||||
case ScriptBaseClass.WL_DRAW_CLASSIC_CLOUDS:
|
||||
toadd.Add(new LSL_Integer(wl.drawClassicClouds ? 1 : 0));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_EAST_ANGLE:
|
||||
case ScriptBaseClass.WL_EAST_ANGLE:
|
||||
toadd.Add(new LSL_Float(wl.eastAngle));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_FRESNEL_OFFSET:
|
||||
case ScriptBaseClass.WL_FRESNEL_OFFSET:
|
||||
toadd.Add(new LSL_Float(wl.fresnelOffset));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_FRESNEL_SCALE:
|
||||
case ScriptBaseClass.WL_FRESNEL_SCALE:
|
||||
toadd.Add(new LSL_Float(wl.fresnelScale));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_HAZE_DENSITY:
|
||||
case ScriptBaseClass.WL_HAZE_DENSITY:
|
||||
toadd.Add(new LSL_Float(wl.hazeDensity));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_HAZE_HORIZON:
|
||||
case ScriptBaseClass.WL_HAZE_HORIZON:
|
||||
toadd.Add(new LSL_Float(wl.hazeHorizon));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_HORIZON:
|
||||
case ScriptBaseClass.WL_HORIZON:
|
||||
toadd.Add(new LSL_Rotation(wl.horizon.X, wl.horizon.Y, wl.horizon.Z, wl.horizon.W));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_LITTLE_WAVE_DIRECTION:
|
||||
case ScriptBaseClass.WL_LITTLE_WAVE_DIRECTION:
|
||||
toadd.Add(new LSL_Vector(wl.littleWaveDirection.X, wl.littleWaveDirection.Y, 0.0f));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_MAX_ALTITUDE:
|
||||
case ScriptBaseClass.WL_MAX_ALTITUDE:
|
||||
toadd.Add(new LSL_Integer(wl.maxAltitude));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_NORMAL_MAP_TEXTURE:
|
||||
case ScriptBaseClass.WL_NORMAL_MAP_TEXTURE:
|
||||
toadd.Add(new LSL_Key(wl.normalMapTexture.ToString()));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_REFLECTION_WAVELET_SCALE:
|
||||
case ScriptBaseClass.WL_REFLECTION_WAVELET_SCALE:
|
||||
toadd.Add(new LSL_Vector(wl.reflectionWaveletScale.X, wl.reflectionWaveletScale.Y, wl.reflectionWaveletScale.Z));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_REFRACT_SCALE_ABOVE:
|
||||
case ScriptBaseClass.WL_REFRACT_SCALE_ABOVE:
|
||||
toadd.Add(new LSL_Float(wl.refractScaleAbove));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_REFRACT_SCALE_BELOW:
|
||||
case ScriptBaseClass.WL_REFRACT_SCALE_BELOW:
|
||||
toadd.Add(new LSL_Float(wl.refractScaleBelow));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_SCENE_GAMMA:
|
||||
case ScriptBaseClass.WL_SCENE_GAMMA:
|
||||
toadd.Add(new LSL_Float(wl.sceneGamma));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_STAR_BRIGHTNESS:
|
||||
case ScriptBaseClass.WL_STAR_BRIGHTNESS:
|
||||
toadd.Add(new LSL_Float(wl.starBrightness));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_SUN_GLOW_FOCUS:
|
||||
case ScriptBaseClass.WL_SUN_GLOW_FOCUS:
|
||||
toadd.Add(new LSL_Float(wl.sunGlowFocus));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_SUN_GLOW_SIZE:
|
||||
case ScriptBaseClass.WL_SUN_GLOW_SIZE:
|
||||
toadd.Add(new LSL_Float(wl.sunGlowSize));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_SUN_MOON_COLOR:
|
||||
case ScriptBaseClass.WL_SUN_MOON_COLOR:
|
||||
toadd.Add(new LSL_Rotation(wl.sunMoonColor.X, wl.sunMoonColor.Y, wl.sunMoonColor.Z, wl.sunMoonColor.W));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_SUN_MOON_POSITION:
|
||||
case ScriptBaseClass.WL_SUN_MOON_POSITION:
|
||||
toadd.Add(new LSL_Float(wl.sunMoonPosition));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_UNDERWATER_FOG_MODIFIER:
|
||||
case ScriptBaseClass.WL_UNDERWATER_FOG_MODIFIER:
|
||||
toadd.Add(new LSL_Float(wl.underwaterFogModifier));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_WATER_COLOR:
|
||||
case ScriptBaseClass.WL_WATER_COLOR:
|
||||
toadd.Add(new LSL_Vector(wl.waterColor.X, wl.waterColor.Y, wl.waterColor.Z));
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_WATER_FOG_DENSITY_EXPONENT:
|
||||
case ScriptBaseClass.WL_WATER_FOG_DENSITY_EXPONENT:
|
||||
toadd.Add(new LSL_Float(wl.waterFogDensityExponent));
|
||||
break;
|
||||
}
|
||||
|
||||
if (toadd.Length > 0)
|
||||
{
|
||||
values.Add(ruleInt);
|
||||
values.Add(new LSL_Integer(rule));
|
||||
values.Add(toadd.Data[0]);
|
||||
}
|
||||
idx++;
|
||||
@@ -257,11 +256,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
int idx = 0;
|
||||
while (idx < rules.Length)
|
||||
{
|
||||
uint rule;
|
||||
int rule;
|
||||
|
||||
try
|
||||
{
|
||||
rule = (uint)rules.GetLSLIntegerItem(idx);
|
||||
rule = rules.GetIntegerItem(idx);
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
@@ -272,7 +271,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
LSL_Types.Vector3 iV;
|
||||
switch (rule)
|
||||
{
|
||||
case (int)ScriptBaseClass.WL_SUN_MOON_POSITION:
|
||||
case ScriptBaseClass.WL_SUN_MOON_POSITION:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -283,7 +282,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_SUN_MOON_POSITION: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_AMBIENT:
|
||||
case ScriptBaseClass.WL_AMBIENT:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -295,7 +294,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
wl.ambient = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_BIG_WAVE_DIRECTION:
|
||||
case ScriptBaseClass.WL_BIG_WAVE_DIRECTION:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -307,7 +306,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
wl.bigWaveDirection = new Vector2((float)iV.x, (float)iV.y);
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_BLUE_DENSITY:
|
||||
case ScriptBaseClass.WL_BLUE_DENSITY:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -319,7 +318,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
wl.blueDensity = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_BLUR_MULTIPLIER:
|
||||
case ScriptBaseClass.WL_BLUR_MULTIPLIER:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -330,7 +329,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_BLUR_MULTIPLIER: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_CLOUD_COLOR:
|
||||
case ScriptBaseClass.WL_CLOUD_COLOR:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -342,7 +341,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
wl.cloudColor = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_CLOUD_COVERAGE:
|
||||
case ScriptBaseClass.WL_CLOUD_COVERAGE:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -353,7 +352,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_CLOUD_COVERAGE: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_CLOUD_DETAIL_XY_DENSITY:
|
||||
case ScriptBaseClass.WL_CLOUD_DETAIL_XY_DENSITY:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -365,7 +364,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
wl.cloudDetailXYDensity = iV;
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_CLOUD_SCALE:
|
||||
case ScriptBaseClass.WL_CLOUD_SCALE:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -376,7 +375,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_CLOUD_SCALE: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_CLOUD_SCROLL_X:
|
||||
case ScriptBaseClass.WL_CLOUD_SCROLL_X:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -387,18 +386,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_CLOUD_SCROLL_X: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_CLOUD_SCROLL_X_LOCK:
|
||||
case ScriptBaseClass.WL_CLOUD_SCROLL_X_LOCK:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
wl.cloudScrollXLock = rules.GetLSLIntegerItem(idx).value == 1 ? true : false;
|
||||
wl.cloudScrollXLock = rules.GetIntegerItem(idx) == 1 ? true : false;
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_CLOUD_SCROLL_Y_LOCK: arg #{0} - parameter 1 must be integer", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_CLOUD_SCROLL_Y:
|
||||
case ScriptBaseClass.WL_CLOUD_SCROLL_Y:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -409,18 +408,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_CLOUD_SCROLL_Y: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_CLOUD_SCROLL_Y_LOCK:
|
||||
case ScriptBaseClass.WL_CLOUD_SCROLL_Y_LOCK:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
wl.cloudScrollYLock = rules.GetLSLIntegerItem(idx).value == 1 ? true : false;
|
||||
wl.cloudScrollYLock = rules.GetIntegerItem(idx) == 1 ? true : false;
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_CLOUD_SCROLL_Y_LOCK: arg #{0} - parameter 1 must be integer", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_CLOUD_XY_DENSITY:
|
||||
case ScriptBaseClass.WL_CLOUD_XY_DENSITY:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -432,7 +431,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
wl.cloudXYDensity = iV;
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_DENSITY_MULTIPLIER:
|
||||
case ScriptBaseClass.WL_DENSITY_MULTIPLIER:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -443,7 +442,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_DENSITY_MULTIPLIER: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_DISTANCE_MULTIPLIER:
|
||||
case ScriptBaseClass.WL_DISTANCE_MULTIPLIER:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -454,18 +453,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_DISTANCE_MULTIPLIER: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_DRAW_CLASSIC_CLOUDS:
|
||||
case ScriptBaseClass.WL_DRAW_CLASSIC_CLOUDS:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
wl.drawClassicClouds = rules.GetLSLIntegerItem(idx).value == 1 ? true : false;
|
||||
wl.drawClassicClouds = rules.GetIntegerItem(idx) == 1 ? true : false;
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_DRAW_CLASSIC_CLOUDS: arg #{0} - parameter 1 must be integer", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_EAST_ANGLE:
|
||||
case ScriptBaseClass.WL_EAST_ANGLE:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -476,7 +475,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_EAST_ANGLE: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_FRESNEL_OFFSET:
|
||||
case ScriptBaseClass.WL_FRESNEL_OFFSET:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -487,7 +486,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_FRESNEL_OFFSET: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_FRESNEL_SCALE:
|
||||
case ScriptBaseClass.WL_FRESNEL_SCALE:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -498,7 +497,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_FRESNEL_SCALE: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_HAZE_DENSITY:
|
||||
case ScriptBaseClass.WL_HAZE_DENSITY:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -509,7 +508,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_HAZE_DENSITY: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_HAZE_HORIZON:
|
||||
case ScriptBaseClass.WL_HAZE_HORIZON:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -520,7 +519,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_HAZE_HORIZON: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_HORIZON:
|
||||
case ScriptBaseClass.WL_HORIZON:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -532,7 +531,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
wl.horizon = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_LITTLE_WAVE_DIRECTION:
|
||||
case ScriptBaseClass.WL_LITTLE_WAVE_DIRECTION:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -544,18 +543,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
wl.littleWaveDirection = new Vector2((float)iV.x, (float)iV.y);
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_MAX_ALTITUDE:
|
||||
case ScriptBaseClass.WL_MAX_ALTITUDE:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
wl.maxAltitude = (ushort)rules.GetLSLIntegerItem(idx).value;
|
||||
wl.maxAltitude = (ushort)rules.GetIntegerItem(idx);
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_MAX_ALTITUDE: arg #{0} - parameter 1 must be integer", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_NORMAL_MAP_TEXTURE:
|
||||
case ScriptBaseClass.WL_NORMAL_MAP_TEXTURE:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -566,7 +565,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_NORMAL_MAP_TEXTURE: arg #{0} - parameter 1 must be key", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_REFLECTION_WAVELET_SCALE:
|
||||
case ScriptBaseClass.WL_REFLECTION_WAVELET_SCALE:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -578,7 +577,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
wl.reflectionWaveletScale = iV;
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_REFRACT_SCALE_ABOVE:
|
||||
case ScriptBaseClass.WL_REFRACT_SCALE_ABOVE:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -589,7 +588,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_REFRACT_SCALE_ABOVE: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_REFRACT_SCALE_BELOW:
|
||||
case ScriptBaseClass.WL_REFRACT_SCALE_BELOW:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -600,7 +599,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_REFRACT_SCALE_BELOW: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_SCENE_GAMMA:
|
||||
case ScriptBaseClass.WL_SCENE_GAMMA:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -611,7 +610,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_SCENE_GAMMA: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_STAR_BRIGHTNESS:
|
||||
case ScriptBaseClass.WL_STAR_BRIGHTNESS:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -622,7 +621,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_STAR_BRIGHTNESS: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_SUN_GLOW_FOCUS:
|
||||
case ScriptBaseClass.WL_SUN_GLOW_FOCUS:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -633,7 +632,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_SUN_GLOW_FOCUS: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_SUN_GLOW_SIZE:
|
||||
case ScriptBaseClass.WL_SUN_GLOW_SIZE:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -644,7 +643,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_SUN_GLOW_SIZE: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_SUN_MOON_COLOR:
|
||||
case ScriptBaseClass.WL_SUN_MOON_COLOR:
|
||||
idx++;
|
||||
iQ = rules.GetVector4Item(idx);
|
||||
try
|
||||
@@ -656,7 +655,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_SUN_MOON_COLOR: arg #{0} - parameter 1 must be rotation", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_UNDERWATER_FOG_MODIFIER:
|
||||
case ScriptBaseClass.WL_UNDERWATER_FOG_MODIFIER:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -667,7 +666,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new InvalidCastException(string.Format("Error running rule WL_UNDERWATER_FOG_MODIFIER: arg #{0} - parameter 1 must be float", idx));
|
||||
}
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_WATER_COLOR:
|
||||
case ScriptBaseClass.WL_WATER_COLOR:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
@@ -679,7 +678,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
wl.waterColor = iV;
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_WATER_FOG_DENSITY_EXPONENT:
|
||||
case ScriptBaseClass.WL_WATER_FOG_DENSITY_EXPONENT:
|
||||
idx++;
|
||||
try
|
||||
{
|
||||
|
||||
@@ -1766,8 +1766,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
// Process the rules, not sure what the impact would be of changing owner or group
|
||||
for (int idx = 0; idx < rules.Length;)
|
||||
{
|
||||
int code = rules.GetLSLIntegerItem(idx++);
|
||||
string arg = rules.GetStringItem(idx++);
|
||||
int code = rules.GetIntegerItem(idx++);
|
||||
string arg = rules.GetStrictStringItem(idx++);
|
||||
switch (code)
|
||||
{
|
||||
case ScriptBaseClass.PARCEL_DETAILS_NAME:
|
||||
@@ -2746,7 +2746,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
while (remaining.Length > 1)
|
||||
{
|
||||
linknumber = remaining.GetLSLIntegerItem(0);
|
||||
linknumber = remaining.GetIntegerItem(0);
|
||||
parts = m_LSL_Api.GetLinkParts(linknumber);
|
||||
if(parts.Count == 0)
|
||||
break;
|
||||
|
||||
@@ -915,49 +915,53 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
return ko;
|
||||
if (o is LSL_Types.LSLString lso)
|
||||
return lso;
|
||||
if (o is string s)
|
||||
return new LSL_Types.LSLString(s);
|
||||
return new LSL_Types.LSLString(o.ToString());
|
||||
}
|
||||
|
||||
public string GetStringItem(int itemIndex)
|
||||
{
|
||||
object o = Data[itemIndex];
|
||||
if (o is LSL_Types.key)
|
||||
return ((LSL_Types.key)o).value;
|
||||
if (o is LSL_Types.LSLString lso)
|
||||
return lso.m_string;
|
||||
if (o is LSL_Types.key lk)
|
||||
return (lk.value);
|
||||
if (o is string s)
|
||||
return s;
|
||||
return o.ToString();
|
||||
}
|
||||
|
||||
public LSL_Types.LSLString GetStrictLSLStringItem(int itemIndex)
|
||||
{
|
||||
object o = Data[itemIndex];
|
||||
if (o is LSL_Types.LSLString)
|
||||
return ((LSL_Types.LSLString)o);
|
||||
if (o is string)
|
||||
return new LSL_Types.LSLString((string)o);
|
||||
if (o is LSL_Types.key)
|
||||
return ((LSL_Types.key)o).value;
|
||||
if (o is LSL_Types.LSLString lso)
|
||||
return lso;
|
||||
if (o is string so)
|
||||
return new LSL_Types.LSLString(so);
|
||||
if (o is LSL_Types.key lko)
|
||||
return new LSL_Types.LSLString(lko.value);
|
||||
|
||||
throw new InvalidCastException(string.Format(
|
||||
"{0} expected but {1} given",
|
||||
typeof(LSL_Types.LSLString).Name,
|
||||
o != null ?
|
||||
o.GetType().Name : "null"));
|
||||
o is not null ? o.GetType().Name : "null"));
|
||||
}
|
||||
|
||||
public string GetStrictStringItem(int itemIndex)
|
||||
{
|
||||
object o = Data[itemIndex];
|
||||
if (o is LSL_Types.LSLString)
|
||||
return ((LSL_Types.LSLString)o).m_string;
|
||||
if (o is string)
|
||||
return (string)o;
|
||||
if (o is LSL_Types.key)
|
||||
return ((LSL_Types.key)o).value;
|
||||
if (o is LSL_Types.LSLString lso)
|
||||
return lso.m_string;
|
||||
if (o is string s)
|
||||
return s;
|
||||
if (o is LSL_Types.key lko)
|
||||
return lko.value;
|
||||
|
||||
throw new InvalidCastException(string.Format(
|
||||
"{0} expected but {1} given",
|
||||
typeof(LSL_Types.LSLString).Name,
|
||||
o != null ?
|
||||
o.GetType().Name : "null"));
|
||||
o is not null ? o.GetType().Name : "null"));
|
||||
}
|
||||
|
||||
|
||||
@@ -966,10 +970,14 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
object o = Data[itemIndex];
|
||||
if (o is LSL_Types.LSLInteger lio)
|
||||
return lio;
|
||||
if (o is int io)
|
||||
return new LSLInteger(io);
|
||||
if (o is LSL_Types.LSLFloat lfo)
|
||||
return new LSLInteger((int)lfo.value);
|
||||
if (o is Int32 io)
|
||||
return new LSLInteger(io);
|
||||
if (o is float fo)
|
||||
return new LSLInteger((int)fo);
|
||||
if (o is double duo)
|
||||
return new LSLInteger((int)duo);
|
||||
if (o is LSL_Types.LSLString lso)
|
||||
return new LSLInteger(lso.m_string);
|
||||
|
||||
@@ -979,6 +987,28 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
o is not null ? o.GetType().Name : "null"));
|
||||
}
|
||||
|
||||
public int GetIntegerItem(int itemIndex)
|
||||
{
|
||||
object o = Data[itemIndex];
|
||||
if (o is LSL_Types.LSLInteger lio)
|
||||
return lio.value;
|
||||
if (o is int io)
|
||||
return io;
|
||||
if (o is LSL_Types.LSLFloat lfo)
|
||||
return (int)lfo.value;
|
||||
if (o is float fo)
|
||||
return (int)fo;
|
||||
if (o is double duo)
|
||||
return (int)duo;
|
||||
if (o is LSL_Types.LSLString lso)
|
||||
return Convert.ToInt32(lso.m_string);
|
||||
|
||||
throw new InvalidCastException(string.Format(
|
||||
"{0} expected but {1} given",
|
||||
typeof(LSL_Types.LSLInteger).Name,
|
||||
o is not null ? o.GetType().Name : "null"));
|
||||
}
|
||||
|
||||
public LSL_Types.Vector3 GetVector3Item(int itemIndex)
|
||||
{
|
||||
object o = Data[itemIndex];
|
||||
|
||||
Reference in New Issue
Block a user