diff options
author | Melanie | 2013-02-05 05:40:51 +0100 |
---|---|---|
committer | Melanie | 2013-02-05 05:40:51 +0100 |
commit | 128910a68139080fbf5ea53db9c756496b605fd9 (patch) | |
tree | 44ba442c50b31a722d81e06b85d37d02b62aebdc /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | Merge branch 'teravuswork' into avination (diff) | |
download | opensim-SC-128910a68139080fbf5ea53db9c756496b605fd9.zip opensim-SC-128910a68139080fbf5ea53db9c756496b605fd9.tar.gz opensim-SC-128910a68139080fbf5ea53db9c756496b605fd9.tar.bz2 opensim-SC-128910a68139080fbf5ea53db9c756496b605fd9.tar.xz |
Make scripts shout a error but not stop when button count is overrun on llDialog
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 16 |
1 files changed, 9 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 53c6e5c..01a649b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4724,7 +4724,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4724 | UUID av = new UUID(); | 4724 | UUID av = new UUID(); |
4725 | if (!UUID.TryParse(agent,out av)) | 4725 | if (!UUID.TryParse(agent,out av)) |
4726 | { | 4726 | { |
4727 | //LSLError("First parameter to llDialog needs to be a key"); | ||
4728 | return; | 4727 | return; |
4729 | } | 4728 | } |
4730 | 4729 | ||
@@ -7222,20 +7221,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7222 | } | 7221 | } |
7223 | if (buttons.Length > 12) | 7222 | if (buttons.Length > 12) |
7224 | { | 7223 | { |
7225 | LSLError("No more than 12 buttons can be shown"); | 7224 | ShoutError("button list too long, must be 12 or fewer entries"); |
7226 | return; | ||
7227 | } | 7225 | } |
7228 | string[] buts = new string[buttons.Length]; | 7226 | int length = buttons.Length; |
7229 | for (int i = 0; i < buttons.Length; i++) | 7227 | if (length > 12) |
7228 | length = 12; | ||
7229 | |||
7230 | string[] buts = new string[length]; | ||
7231 | for (int i = 0; i < length; i++) | ||
7230 | { | 7232 | { |
7231 | if (buttons.Data[i].ToString() == String.Empty) | 7233 | if (buttons.Data[i].ToString() == String.Empty) |
7232 | { | 7234 | { |
7233 | LSLError("button label cannot be blank"); | 7235 | ShoutError("button label cannot be blank"); |
7234 | return; | 7236 | return; |
7235 | } | 7237 | } |
7236 | if (buttons.Data[i].ToString().Length > 24) | 7238 | if (buttons.Data[i].ToString().Length > 24) |
7237 | { | 7239 | { |
7238 | llWhisper(ScriptBaseClass.DEBUG_CHANNEL, "button label cannot be longer than 24 characters"); | 7240 | ShoutError("button label cannot be longer than 24 characters"); |
7239 | return; | 7241 | return; |
7240 | } | 7242 | } |
7241 | buts[i] = buttons.Data[i].ToString(); | 7243 | buts[i] = buttons.Data[i].ToString(); |