Fix whitelist string -> array error in checkPbo

Fix #2913
Use splitString instead of call compile to convert string into an array
This commit is contained in:
PabstMirror 2015-12-02 23:58:41 -06:00
parent c928a0d6cb
commit 91ace4fc9b
2 changed files with 8 additions and 4 deletions

View File

@ -167,7 +167,7 @@ call FUNC(checkFiles);
[ [
GVAR(checkPBOsAction), GVAR(checkPBOsAction),
GVAR(checkPBOsCheckAll), GVAR(checkPBOsCheckAll),
call compile GVAR(checkPBOsWhitelist) GVAR(checkPBOsWhitelist)
] call FUNC(checkPBOs) ] call FUNC(checkPBOs)
}] call FUNC(addEventHandler); }] call FUNC(addEventHandler);

View File

@ -9,7 +9,7 @@
* 1 = Warn permanently * 1 = Warn permanently
* 2 = Kick * 2 = Kick
* 1: Check all PBOs? (default: false) <BOOL> * 1: Check all PBOs? (default: false) <BOOL>
* 2: Whitelist (default: "[]") <STRING> * 2: Whitelist (default: "") <STRING>
* *
* Return Value: * Return Value:
* None * None
@ -18,9 +18,13 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_mode", ["_checkAll", false], ["_whitelist", "[]"]]; params ["_mode", ["_checkAll", false], ["_whitelist", "", [""]]];
TRACE_3("params",_mode,_checkAll,_whitelist);
_whitelist = [_whitelist, {toLower _this}] call FUNC(map); //lowercase and convert whiteList String into array of strings:
_whitelist = toLower _whitelist;
_whitelist = _whitelist splitString "[,""']";
TRACE_1("Array",_whitelist);
ACE_Version_CheckAll = _checkAll; ACE_Version_CheckAll = _checkAll;
ACE_Version_Whitelist = _whitelist; ACE_Version_Whitelist = _whitelist;