From 0420f0b2164f42d9358690933ba98c1c00219a42 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sun, 16 Aug 2015 00:15:16 +0200 Subject: [PATCH] Fixed error pop-up kicking you out of game in case a third party vehicle has incorrect configured hitpoints/selections --- .../functions/fnc_getHitPointsWithSelections.sqf | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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; + }; }; };