diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs | 20 |
2 files changed, 23 insertions, 7 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 0cfa06f..f49cf0c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4002,20 +4002,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4002 | return 0; | 4002 | return 0; |
4003 | } | 4003 | } |
4004 | 4004 | ||
4005 | if (src.Data[index] is Int32) | 4005 | if (src.Data[index] is LSL_Types.LSLInteger || src.Data[index] is Int32) |
4006 | return 1; | 4006 | return 1; |
4007 | if (src.Data[index] is Double) | 4007 | if (src.Data[index] is LSL_Types.LSLFloat || src.Data[index] is Single || src.Data[index] is Double) |
4008 | return 2; | 4008 | return 2; |
4009 | if (src.Data[index] is String) | 4009 | if (src.Data[index] is LSL_Types.LSLString || src.Data[index] is String) |
4010 | { | 4010 | { |
4011 | UUID tuuid; | 4011 | UUID tuuid; |
4012 | if (UUID.TryParse(src.Data[index].ToString(), out tuuid)) | 4012 | if (UUID.TryParse(src.Data[index].ToString(), out tuuid)) |
4013 | { | 4013 | { |
4014 | return 3; | 4014 | return 4; |
4015 | } | 4015 | } |
4016 | else | 4016 | else |
4017 | { | 4017 | { |
4018 | return 4; | 4018 | return 3; |
4019 | } | 4019 | } |
4020 | } | 4020 | } |
4021 | if (src.Data[index] is LSL_Types.Vector3) | 4021 | if (src.Data[index] is LSL_Types.Vector3) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs index f856ea5..b32fce6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs | |||
@@ -138,7 +138,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
138 | c.Data = data; | 138 | c.Data = data; |
139 | vars[field.Name] = c; | 139 | vars[field.Name] = c; |
140 | } | 140 | } |
141 | else | 141 | else if(field.FieldType == typeof(LSL_Types.LSLInteger) || |
142 | field.FieldType == typeof(LSL_Types.LSLString) || | ||
143 | field.FieldType == typeof(LSL_Types.LSLFloat) || | ||
144 | field.FieldType == typeof(Int32) || | ||
145 | field.FieldType == typeof(Double) || | ||
146 | field.FieldType == typeof(Single) || | ||
147 | field.FieldType == typeof(String) || | ||
148 | field.FieldType == typeof(Byte) || | ||
149 | field.FieldType == typeof(Short)) | ||
142 | { | 150 | { |
143 | vars[field.Name] = field.GetValue(this); | 151 | vars[field.Name] = field.GetValue(this); |
144 | } | 152 | } |
@@ -161,7 +169,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
161 | Array.Copy(data, 0, v.Data, 0, data.Length); | 169 | Array.Copy(data, 0, v.Data, 0, data.Length); |
162 | m_Fields[var.Key].SetValue(this, v); | 170 | m_Fields[var.Key].SetValue(this, v); |
163 | } | 171 | } |
164 | else | 172 | else if(field.FieldType == typeof(LSL_Types.LSLInteger) || |
173 | field.FieldType == typeof(LSL_Types.LSLString) || | ||
174 | field.FieldType == typeof(LSL_Types.LSLFloat) || | ||
175 | field.FieldType == typeof(Int32) || | ||
176 | field.FieldType == typeof(Double) || | ||
177 | field.FieldType == typeof(Single) || | ||
178 | field.FieldType == typeof(String) || | ||
179 | field.FieldType == typeof(Byte) || | ||
180 | field.FieldType == typeof(Short)) | ||
165 | { | 181 | { |
166 | m_Fields[var.Key].SetValue(this, var.Value); | 182 | m_Fields[var.Key].SetValue(this, var.Value); |
167 | } | 183 | } |