2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-04-07 12:44:34 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
*
|
|
|
|
* Returns all lighting hitpoints of any vehicle.
|
|
|
|
* Note: These are actual selections that are affected by setHit and getHit, not getHitPointDamage or setHitpointDamage.
|
|
|
|
* They behave like having an armor value of 0.
|
|
|
|
*
|
|
|
|
* Arguments:
|
2015-09-21 11:53:12 +00:00
|
|
|
* 0: Vehicle <OBJECT>
|
2015-04-07 12:44:34 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2015-09-21 11:53:12 +00:00
|
|
|
* 0: Light Hitpoints <ARRAY>
|
|
|
|
* 1: Selections <ARRAY>
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [car] call ace_common_fnc_getReflectorsWithSelections
|
|
|
|
*
|
2015-09-21 11:53:12 +00:00
|
|
|
* Public: Yes
|
2015-04-07 12:44:34 +00:00
|
|
|
*/
|
|
|
|
|
2015-09-21 11:53:12 +00:00
|
|
|
params ["_vehicle"];
|
2015-04-07 12:44:34 +00:00
|
|
|
|
2015-12-12 15:48:54 +00:00
|
|
|
private _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
2015-04-07 12:44:34 +00:00
|
|
|
|
2015-12-12 15:48:54 +00:00
|
|
|
private _hitpoints = [];
|
|
|
|
private _selections = [];
|
2015-04-07 12:44:34 +00:00
|
|
|
|
|
|
|
// iterate through all parents
|
|
|
|
while {isClass _config} do {
|
2015-12-12 15:48:54 +00:00
|
|
|
private _class = _config >> "Reflectors";
|
2015-04-07 12:44:34 +00:00
|
|
|
|
|
|
|
for "_i" from 0 to (count _class - 1) do {
|
2015-12-12 15:48:54 +00:00
|
|
|
private _entry = _class select _i;
|
|
|
|
private _selection = getText (_entry >> "hitpoint");
|
2015-04-07 12:44:34 +00:00
|
|
|
|
|
|
|
if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then {
|
|
|
|
_hitpoints pushBack configName _entry;
|
|
|
|
_selections pushBack _selection;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
_config = inheritsFrom _config;
|
|
|
|
};
|
|
|
|
|
|
|
|
[_hitPoints, _selections]
|