ACE3/addons/medical_damage/functions/fnc_parseWoundHandlersCfg.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

34 lines
933 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: Pterolatypus
* Read a list of wound handler entries from config, accounting for inheritance
*
* Arguments:
* 0: The config class containing the entries <CONFIG>
*
* ReturnValue:
* None
*
* Example:
* [configFile >> "ace_medical_injuries" >> "damageTypes"] call ace_medical_damage_fnc_parseWoundHandlersCfg
*
* Public: No
*/
params ["_config"];
// read all valid entries from config and store
private _entries = [];
{
private _entryResult = call compile getText _x;
if !(isNil "_entryResult") then {
_entries pushBack _entryResult;
}
} forEach configProperties [_config, "isText _x", false];
private _parent = inheritsFrom _config;
if (isNull _parent) exitWith {_entries};
// recursive call for parent
// can't use configProperties for inheritance since it returns entries in the wrong order
([_parent] call FUNC(parseWoundHandlersCfg)) + _entries;