diff options
author | UbitUmarov | 2016-08-21 00:57:25 +0100 |
---|---|---|
committer | UbitUmarov | 2016-08-21 00:57:25 +0100 |
commit | d9647dbf7cabc4c572a656a43729fe0c9318a759 (patch) | |
tree | 390d6cf00d7c14e2035b967d6c8c169f3494e92d /OpenSim/Region | |
parent | fix terrain BMP image format on SaveStream mantis: 8001 (diff) | |
download | opensim-SC_OLD-d9647dbf7cabc4c572a656a43729fe0c9318a759.zip opensim-SC_OLD-d9647dbf7cabc4c572a656a43729fe0c9318a759.tar.gz opensim-SC_OLD-d9647dbf7cabc4c572a656a43729fe0c9318a759.tar.bz2 opensim-SC_OLD-d9647dbf7cabc4c572a656a43729fe0c9318a759.tar.xz |
fix llSetText utf8 string size cliping
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 7931ff5..d460681 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4741,20 +4741,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4741 | { | 4741 | { |
4742 | m_host.AddScriptLPS(1); | 4742 | m_host.AddScriptLPS(1); |
4743 | Vector3 av3 = Util.Clip(color, 0.0f, 1.0f); | 4743 | Vector3 av3 = Util.Clip(color, 0.0f, 1.0f); |
4744 | if (text.Length > 254) | ||
4745 | text = text.Remove(254); | ||
4746 | |||
4747 | byte[] data; | 4744 | byte[] data; |
4748 | do | 4745 | data = Util.StringToBytes256(text); |
4749 | { | 4746 | text = Util.UTF8.GetString(data); |
4750 | data = Util.UTF8.GetBytes(text); | ||
4751 | if (data.Length > 254) | ||
4752 | text = text.Substring(0, text.Length - 1); | ||
4753 | } while (data.Length > 254); | ||
4754 | |||
4755 | m_host.SetText(text, av3, Util.Clip((float)alpha, 0.0f, 1.0f)); | 4747 | m_host.SetText(text, av3, Util.Clip((float)alpha, 0.0f, 1.0f)); |
4756 | //m_host.ParentGroup.HasGroupChanged = true; | ||
4757 | //m_host.ParentGroup.ScheduleGroupForFullUpdate(); | ||
4758 | } | 4748 | } |
4759 | 4749 | ||
4760 | public LSL_Float llWater(LSL_Vector offset) | 4750 | public LSL_Float llWater(LSL_Vector offset) |