Epoch/Sources/epoch_code/compile/both/EPOCH_getHitpoints.sqf
2015-09-14 15:55:36 -05:00

12 lines
451 B
Plaintext

private["_hitpoints", "_type", "_cachekey", "_na"];
_hitpoints = [];
if (!isNull _this) then {
_type = typeOf _this;
_cachekey = format["%1_HP", _type];
_hitpoints = missionNamespace getVariable[_cachekey, []];
if (_hitpoints isEqualTo []) then {
_na = configProperties[configFile >> "CfgVehicles" >> _type >> "HitPoints", "_hitpoints pushBack configName _x; true", true];
missionNamespace setVariable[_cachekey, _hitpoints];
};
};
_hitpoints