YEngine store a bool as integer on a lsl list in one initialization case

This commit is contained in:
UbitUmarov
2023-06-20 20:59:04 +01:00
parent 2849e57920
commit 1606ce4138
2 changed files with 9 additions and 6 deletions

View File

@@ -1124,8 +1124,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
object[] tmp;
if (m_data is null || m_data.Length == 0)
{
tmp = new object[1];
tmp.SetValue(o, 0);
tmp = new object[] {o};
}
else
{
@@ -1194,8 +1193,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
object[] tmp;
if (m_data is null || m_data.Length == 0)
{
tmp = new object[1];
tmp[0] = o;
tmp = new object[] { o };
}
else
{

View File

@@ -4908,12 +4908,17 @@ namespace OpenSim.Region.ScriptEngine.Yengine
ilGen.Emit(val, OpCodes.Newobj, lslFloatConstructorInfo);
ilGen.Emit(val, OpCodes.Box, typeof(LSL_Float));
}
else if(eRVal.type is TokenTypeInt)
else if (eRVal.type is TokenTypeInt)
{
ilGen.Emit(val, OpCodes.Newobj, lslIntegerConstructorInfo);
ilGen.Emit(val, OpCodes.Box, typeof(LSL_Integer));
}
else if((eRVal.type is TokenTypeKey) || (eRVal.type is TokenTypeStr))
else if (eRVal.type is TokenTypeBool)
{
ilGen.Emit(val, OpCodes.Newobj, lslIntegerConstructorInfo);
ilGen.Emit(val, OpCodes.Box, typeof(LSL_Integer));
}
else if ((eRVal.type is TokenTypeKey) || (eRVal.type is TokenTypeStr))
{
ilGen.Emit(val, OpCodes.Newobj, lslStringConstructorInfo);
ilGen.Emit(val, OpCodes.Box, typeof(LSL_String));