2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2016-05-03 20:37:02 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
2016-07-04 22:04:58 +00:00
|
|
|
* Get the mine detector configuration from the cache or config file
|
2016-05-03 20:37:02 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Detector class name <STRING>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Detector configuration or empty array if invalid <ARRAY>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* ["my_detector"] call ace_minedetector_fnc_getDetectorConfig
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_detectorType"];
|
|
|
|
|
2016-12-02 16:09:48 +00:00
|
|
|
if (_detectorType isEqualTo "") exitWith {[]};
|
|
|
|
|
2024-06-11 15:34:32 +00:00
|
|
|
GVAR(detectorConfigs) getOrDefaultCall [_detectorType, {
|
2016-07-04 22:04:58 +00:00
|
|
|
private _cfgEntry = (configFile >> "ACE_detector" >> "detectors" >> _detectorType);
|
|
|
|
if (isClass _cfgEntry) then {
|
2024-06-11 15:34:32 +00:00
|
|
|
[
|
2016-07-04 22:04:58 +00:00
|
|
|
_detectorType,
|
|
|
|
getNumber (_cfgEntry >> "radius"),
|
2016-07-07 01:14:26 +00:00
|
|
|
getArray (_cfgEntry >> "sounds")
|
2016-07-04 22:04:58 +00:00
|
|
|
];
|
|
|
|
} else {
|
2024-06-11 15:34:32 +00:00
|
|
|
[]
|
2016-07-04 22:04:58 +00:00
|
|
|
};
|
2024-06-11 15:34:32 +00:00
|
|
|
}, true]
|