diff --git a/addons/repair/functions/fnc_addRepairActions.sqf b/addons/repair/functions/fnc_addRepairActions.sqf index 03c6ec79a6..437332d04f 100644 --- a/addons/repair/functions/fnc_addRepairActions.sqf +++ b/addons/repair/functions/fnc_addRepairActions.sqf @@ -31,7 +31,7 @@ if (_type in _initializedClasses) exitWith {}; if (_type == "") exitWith {}; // get selections to ignore -private _selectionsToIgnore = _vehicle call FUNC(getSelectionsToIgnore); +([_vehicle] call FUNC(getSelectionsToIgnore)) params["_selectionsToIgnore", "_dependsArray"]; // get all hitpoints and selections (getAllHitPointsDamage _vehicle) params [["_hitPoints", []], ["_hitSelections", []]]; // Since 1.82 these are all lower case @@ -156,6 +156,15 @@ private _turretPaths = ((fullCrew [_vehicle, "gunner", true]) + (fullCrew [_vehi _hitPointsAddedStrings = _trackArray select 1; _hitPointsAddedAmount = _trackArray select 2; + // Add name of dependant hitpoints to the parent hitpoint + { + if (_hitpoint == (_x select 0)) then { + private _dependsHitpoint = (_x select 1); + ([_dependsHitpoint, "%1", _dependsHitpoint, [_hitPointsAddedNames, _hitPointsAddedStrings, _hitPointsAddedAmount]] call FUNC(getHitPointString)) params ["_dependsText", ""]; + _text = _text + " / " + _dependsText; + }; + } forEach _dependsArray; + if (_hitpoint in TRACK_HITPOINTS) then { _position = compile format ["private _return = _target selectionPosition ['%1', 'HitPoints']; _return set [1, 0]; _return", _selection]; TRACE_4("Adding RepairTrack",_hitpoint,_forEachIndex,_selection,_text); diff --git a/addons/repair/functions/fnc_fullRepairProgress.sqf b/addons/repair/functions/fnc_fullRepairProgress.sqf index b021c492c0..ff6ef749bf 100644 --- a/addons/repair/functions/fnc_fullRepairProgress.sqf +++ b/addons/repair/functions/fnc_fullRepairProgress.sqf @@ -32,7 +32,7 @@ if (_totalTime - _elapsedTime > ([_engineer, _vehicle] call FUNC(getFullRepairTi private _allHitPointsDamage = getAllHitPointsDamage _vehicle; _allHitPointsDamage params ["_hitPoints", "", "_damageValues"]; -private _selectionsToIgnore = _vehicle call FUNC(getSelectionsToIgnore); +([_vehicle] call FUNC(getSelectionsToIgnore)) params["_selectionsToIgnore", ""]; private _firstDamagedIndex = { if (_x > 0 && {!(_forEachIndex in _selectionsToIgnore)}) exitWith {_forEachIndex}; diff --git a/addons/repair/functions/fnc_getFullRepairTime.sqf b/addons/repair/functions/fnc_getFullRepairTime.sqf index a570685328..9536576d94 100644 --- a/addons/repair/functions/fnc_getFullRepairTime.sqf +++ b/addons/repair/functions/fnc_getFullRepairTime.sqf @@ -21,7 +21,7 @@ params ["_engineer", "_vehicle"]; private _allHitPointsDamage = getAllHitPointsDamage _vehicle; _allHitPointsDamage params ["_hitPoints", "", "_damageValues"]; -private _selectionsToIgnore = _vehicle call FUNC(getSelectionsToIgnore); +([_vehicle] call FUNC(getSelectionsToIgnore)) params["_selectionsToIgnore", ""]; private _repairsNeeded = 0; private _doExtraRepair = false; diff --git a/addons/repair/functions/fnc_getSelectionsToIgnore.sqf b/addons/repair/functions/fnc_getSelectionsToIgnore.sqf index d455950a3b..20d8518435 100644 --- a/addons/repair/functions/fnc_getSelectionsToIgnore.sqf +++ b/addons/repair/functions/fnc_getSelectionsToIgnore.sqf @@ -31,6 +31,7 @@ private _turretPaths = ((fullCrew [_vehicle, "gunner", true]) + (fullCrew [_vehi ([_vehicle] call FUNC(getWheelHitPointsWithSelections)) params ["_wheelHitPoints", "_wheelHitSelections"]; private _indexesToIgnore = []; +private _dependsArray = []; private _processedSelections = []; { @@ -128,8 +129,10 @@ private _processedSelections = []; ERROR_2("[%1] hitpoint [%2] is both a group-parent and a depends and will be unrepairable",_type,_hitpoint); ERROR_1("group: %1",_hitpointGroups # _groupIndex); }; + private _dependsParentHitpoint = [_vehCfg >> "HitPoints" >> _hitpoint, "depends"] call BIS_fnc_returnConfigEntry; _indexesToIgnore pushBack _forEachIndex; + _dependsArray pushBack [_dependsParentHitpoint, _hitpoint]; _processedSelections pushBack _selection; continue }; @@ -150,4 +153,4 @@ private _processedSelections = []; _initializedClasses set [_type, _indexesToIgnore]; missionNamespace setVariable [QGVAR(hitPointsToIgnoreInitializedClasses), _initializedClasses]; -_indexesToIgnore +[_indexesToIgnore, _dependsArray]