Mantis#1451. Thank you kindly, Mikem for a patch that addresses:

LSL scripts in which a float type is cast to a string or a string type 
is cast to a float do not compile. When the script is translated from 
LSL to C#, the LSL float type is translated into double. There is no 
string <-> double cast in C#, so compilation fails.
There is a LSLFloat type, however it seems unfinished and is not used.
I am attaching a patch that implements the LSLFloat type. I have also 
added two methods to the LSLString type to facilitate float <-> string casts.
This commit is contained in:
Charles Krinke
2008-06-05 13:54:20 +00:00
parent e12baa5eb3
commit 3a4b54adaa
2 changed files with 65 additions and 10 deletions

View File

@@ -52,7 +52,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
// Only the types we need to convert
dataTypes.Add("void", "void");
dataTypes.Add("integer", "LSL_Types.LSLInteger");
dataTypes.Add("float", "double");
dataTypes.Add("float", "LSL_Types.LSLFloat");
dataTypes.Add("string", "LSL_Types.LSLString");
dataTypes.Add("key", "LSL_Types.LSLString");
dataTypes.Add("vector", "LSL_Types.Vector3");