mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-17 21:52:56 +03:00
0.1
This commit is contained in:
26
dayz_code/compile/vehicle_getHitpoints.sqf
Normal file
26
dayz_code/compile/vehicle_getHitpoints.sqf
Normal file
@@ -0,0 +1,26 @@
|
||||
private ["_cfgHitPoints", "_hps", "_funcGetHitPoints"];
|
||||
_cfgHitPoints = configFile >> "CfgVehicles" >> (typeOf _this) >> "HitPoints";
|
||||
_hps = [];
|
||||
|
||||
_funcGetHitPoints =
|
||||
{
|
||||
for "_i" from 0 to ((count _this) - 1) do
|
||||
{
|
||||
private ["_hp"];
|
||||
_hp = configName (_this select _i);
|
||||
|
||||
if (!(_hp in _hps)) then
|
||||
{
|
||||
_hps set [count _hps, _hp];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//Explore inheritance structure fully
|
||||
while {(configName _cfgHitPoints) != ""} do
|
||||
{
|
||||
_cfgHitPoints call _funcGetHitPoints;
|
||||
_cfgHitPoints = inheritsFrom _cfgHitPoints;
|
||||
};
|
||||
|
||||
_hps
|
||||
Reference in New Issue
Block a user