2015-01-16 23:21:47 +00:00
|
|
|
/**
|
|
|
|
* fn_inheritsFrom.sqf
|
|
|
|
* @Descr: Checks whether a given configuration name appears in the inheritance tree of a specific configuration entry.
|
|
|
|
* @Author: Ruthberg
|
|
|
|
*
|
|
|
|
* @Arguments: [configEntry CONFIG, configname STRING]
|
|
|
|
* @Return: BOOL
|
|
|
|
* @PublicAPI: true
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-05-14 18:06:06 +00:00
|
|
|
private ["_match"];
|
|
|
|
PARAMS_2(_configEntry,_configMatch);
|
2015-01-16 23:21:47 +00:00
|
|
|
|
|
|
|
if (configName _configEntry == _configMatch) exitWith { true };
|
|
|
|
if (configName _configEntry == ",") exitWith { false };
|
|
|
|
|
|
|
|
_match = false;
|
|
|
|
while {configName _configEntry != ""} do {
|
2015-01-18 19:09:19 +00:00
|
|
|
if (configName _configEntry == _configMatch) exitWith { _match = true };
|
|
|
|
_configEntry = inheritsFrom(_configEntry);
|
2015-01-16 23:21:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
_match
|