aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs29
1 files changed, 11 insertions, 18 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
index 1efe798..0b41bc6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
@@ -729,7 +729,8 @@ namespace SecondLife
729 public int Compare(KeyValuePair<int, int> a, 729 public int Compare(KeyValuePair<int, int> a,
730 KeyValuePair<int, int> b) 730 KeyValuePair<int, int> b)
731 { 731 {
732 return a.Key.CompareTo(b.Key); 732 int kc = a.Key.CompareTo(b.Key);
733 return (kc != 0) ? kc : a.Value.CompareTo(b.Value);
733 } 734 }
734 } 735 }
735 736
@@ -751,27 +752,19 @@ namespace SecondLife
751 752
752 sorted.Sort(new kvpSorter()); 753 sorted.Sort(new kvpSorter());
753 754
754 int l = 1; 755 int l = sorted[0].Key;
755 int c = 1; 756 int c = sorted[0].Value;
756 757
757 foreach (KeyValuePair<int, int> cspos in sorted) 758 foreach (KeyValuePair<int, int> cspos in sorted)
758 { 759 {
759 if (cspos.Key >= line) 760 if (cspos.Key >= line &&
760 { 761 !(cspos.Key == line && cspos.Value <= col))
761 if (cspos.Key > line) 762 break;
762 return new KeyValuePair<int, int>(l, c); 763 l = cspos.Key;
763 if (cspos.Value > col) 764 c = cspos.Value;
764 return new KeyValuePair<int, int>(l, c);
765 c = cspos.Value;
766 if (c == 0)
767 c++;
768 }
769 else
770 {
771 l = cspos.Key;
772 }
773 } 765 }
774 return new KeyValuePair<int, int>(l, c); 766 positionMap.TryGetValue(new KeyValuePair<int, int>(l, c), out ret);
767 return ret;
775 } 768 }
776 769
777 string ReplaceTypes(string message) 770 string ReplaceTypes(string message)