mirror of
https://github.com/openbullet/openbullet.git
synced 2023-10-21 07:33:42 -05:00
List variables are now correctly converted to Jint arrays.
This commit is contained in:
@@ -488,7 +488,23 @@ namespace RuriLib.LS
|
||||
// Add in all the variables
|
||||
foreach (var variable in data.Variables.All)
|
||||
{
|
||||
try { jsengine.SetValue(variable.Name, variable.Value); } catch { }
|
||||
try
|
||||
{
|
||||
switch (variable.Type)
|
||||
{
|
||||
case CVar.VarType.Single:
|
||||
jsengine.SetValue(variable.Name, variable.Value);
|
||||
break;
|
||||
|
||||
case CVar.VarType.List:
|
||||
jsengine.SetValue(variable.Name, (variable.Value as List<string>).ToArray());
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
// Execute JS
|
||||
|
||||
Reference in New Issue
Block a user