diff --git a/addons/common/functions/fnc_getHitPointsWithSelections.sqf b/addons/common/functions/fnc_getHitPointsWithSelections.sqf index 2bf568ec8a..b66700881e 100644 --- a/addons/common/functions/fnc_getHitPointsWithSelections.sqf +++ b/addons/common/functions/fnc_getHitPointsWithSelections.sqf @@ -41,14 +41,15 @@ _hitpointClasses = [_config >> "HitPoints"]; while {isClass _class} do { for "_i" from 0 to (count _class - 1) do { - private ["_entry", "_selection"]; + if (isClass (_class select _i)) then { + private ["_entry", "_selection"]; + _entry = configName (_class select _i); + _selection = getText (_class select _i >> "name"); - _entry = configName (_class select _i); - _selection = getText (_class select _i >> "name"); - - if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then { - _hitpoints pushBack _entry; - _selections pushBack _selection; + if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then { + _hitpoints pushBack _entry; + _selections pushBack _selection; + }; }; };