mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Minedetector - Cache detectableClasses (#6805)
* Cache minedetector detectableClasses * use compileFinal
This commit is contained in:
parent
21fd4e5d16
commit
0c8c924487
@ -5,16 +5,12 @@ GVAR(detectorConfigs) = call CBA_fnc_createNamespace;
|
|||||||
|
|
||||||
// Create a dictionary of detectable classnames
|
// Create a dictionary of detectable classnames
|
||||||
GVAR(detectableClasses) = call CBA_fnc_createNamespace;
|
GVAR(detectableClasses) = call CBA_fnc_createNamespace;
|
||||||
|
|
||||||
|
private _detectableClasses = call (uiNamespace getVariable [QGVAR(detectableClasses), {[]}]); //See XEH_preStart.sqf
|
||||||
{
|
{
|
||||||
if ((getNumber (_x >> QGVAR(detectable))) == 1) then {
|
GVAR(detectableClasses) setVariable [_x, true];
|
||||||
GVAR(detectableClasses) setVariable [configName _x, true];
|
} forEach _detectableClasses;
|
||||||
};
|
TRACE_1("built cache",count allVariables GVAR(detectableClasses));
|
||||||
} forEach (configProperties [configFile >> "CfgVehicles", "isClass _x", true]);
|
|
||||||
{
|
|
||||||
if ((getNumber (_x >> QGVAR(detectable))) == 1) then {
|
|
||||||
GVAR(detectableClasses) setVariable [configName _x, true];
|
|
||||||
};
|
|
||||||
} forEach (configProperties [configFile >> "CfgAmmo", "isClass _x", true]);
|
|
||||||
|
|
||||||
[QGVAR(enableDetector), FUNC(enableDetector)] call CBA_fnc_addEventHandler;
|
[QGVAR(enableDetector), FUNC(enableDetector)] call CBA_fnc_addEventHandler;
|
||||||
[QGVAR(disableDetector), FUNC(disableDetector)] call CBA_fnc_addEventHandler;
|
[QGVAR(disableDetector), FUNC(disableDetector)] call CBA_fnc_addEventHandler;
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
#include "XEH_PREP.hpp"
|
#include "XEH_PREP.hpp"
|
||||||
|
|
||||||
|
// Cache detectable classes, see XEH_postInit.sqf
|
||||||
|
private _detectableClasses = [];
|
||||||
|
{
|
||||||
|
if ((getNumber (_x >> QGVAR(detectable))) == 1) then {
|
||||||
|
_detectableClasses pushBackUnique configName _x;
|
||||||
|
};
|
||||||
|
} forEach (configProperties [configFile >> "CfgVehicles", "isClass _x", true]);
|
||||||
|
{
|
||||||
|
if ((getNumber (_x >> QGVAR(detectable))) == 1) then {
|
||||||
|
_detectableClasses pushBackUnique configName _x;
|
||||||
|
};
|
||||||
|
} forEach (configProperties [configFile >> "CfgAmmo", "isClass _x", true]);
|
||||||
|
|
||||||
|
TRACE_1("compiled",count _detectableClasses);
|
||||||
|
uiNamespace setVariable [QGVAR(detectableClasses), compileFinal str _detectableClasses];
|
||||||
|
Loading…
Reference in New Issue
Block a user