Fixed regex in LSL2CSConverter so it will properly handle casting to (string) part of vector (eg. vector.z)

This fixes Mantis 388
ThreadPoolClientBranch
alondria 2008-02-06 02:30:05 +00:00
parent 31576c8a26
commit 52af264948
1 changed files with 2 additions and 2 deletions

View File

@ -271,10 +271,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
// Replace (string) to .ToString() //
Script =
Regex.Replace(Script, @"\(string\)\s*([a-zA-Z0-9_]+(\s*\([^\)]*\))?)", @"$1.ToString()",
Regex.Replace(Script, @"\(string\)\s*([a-zA-Z0-9_.]+(\s*\([^\)]*\))?)", @"$1.ToString()",
RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
Script =
Regex.Replace(Script, @"\((float|int)\)\s*([a-zA-Z0-9_]+(\s*\([^\)]*\))?)", @"$1.Parse($2)",
Regex.Replace(Script, @"\((float|int)\)\s*([a-zA-Z0-9_.]+(\s*\([^\)]*\))?)", @"$1.Parse($2)",
RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);