Make scripts shout a error but not stop when button count is overrun on llDialog

avinationmerge
Melanie 2013-02-05 05:40:51 +01:00
parent 1e354f70d2
commit 128910a681
1 changed files with 9 additions and 7 deletions

View File

@ -4724,7 +4724,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
UUID av = new UUID();
if (!UUID.TryParse(agent,out av))
{
//LSLError("First parameter to llDialog needs to be a key");
return;
}
@ -7222,20 +7221,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
if (buttons.Length > 12)
{
LSLError("No more than 12 buttons can be shown");
return;
ShoutError("button list too long, must be 12 or fewer entries");
}
string[] buts = new string[buttons.Length];
for (int i = 0; i < buttons.Length; i++)
int length = buttons.Length;
if (length > 12)
length = 12;
string[] buts = new string[length];
for (int i = 0; i < length; i++)
{
if (buttons.Data[i].ToString() == String.Empty)
{
LSLError("button label cannot be blank");
ShoutError("button label cannot be blank");
return;
}
if (buttons.Data[i].ToString().Length > 24)
{
llWhisper(ScriptBaseClass.DEBUG_CHANNEL, "button label cannot be longer than 24 characters");
ShoutError("button label cannot be longer than 24 characters");
return;
}
buts[i] = buttons.Data[i].ToString();