Skip to content

Commit

Permalink
Advanced Veh Repair Fix #2 after Tank DLC
Browse files Browse the repository at this point in the history
  • Loading branch information
He-Man authored and He-Man committed Apr 13, 2018
1 parent f9de95f commit 3966ad7
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 84 deletions.
Expand Up @@ -31,7 +31,7 @@ _wheelcounter = 0;
_x params ["_searchedhit","_limit1","_limit2"];
_searchedhit = tolower _searchedhit;
if (_searchedhit isequalto _HitPointName) then {
_wheel = ["wheel",tolower _searchedhit] call bis_fnc_instring;
_wheel = ["wheel",_searchedhit] call bis_fnc_instring;
if (_wheel) then {
_wheelcounter = _wheelcounter + 1;
};
Expand All @@ -43,15 +43,15 @@ _wheelcounter = 0;
_repairs pushback _searchedhit;
};
if (!((_veh getvariable ["vehicle_slot","-1"]) isequalto "-1") && _EnableRemoveParts) then {
if (_searchedhit in ["HitLFWheel","HitLF2Wheel","HitLMWheel","HitLBWheel","HitRFWheel","HitRF2Wheel","HitRMWheel","HitRBWheel","HitEngine"]) then {
if (_searchedhit in ["hitlfwheel","hitlf2wheel","hitlmwheel","hitlbwheel","hitrfwheel","hitrf2wheel","hitrmwheel","hitrbwheel","hitengine"]) then {
_removes pushback _searchedhit;
};
};
}
else {
if (_searchedhit isequalto "glass") then {
if ("glass" in _repairs) exitwith {};
_glass = ["glass",tolower _HitPointName] call bis_fnc_instring;
_glass = ["glass",_HitPointName] call bis_fnc_instring;
if (_glass) then {
if (_Hit >= _limit1) exitwith {
_repairs pushback _searchedhit;
Expand All @@ -64,7 +64,8 @@ _wheelcounter = 0;

_repairarrays = [];
{
if (!(_x in _repairs || _x in _replaces || (["glass",tolower _x] call Bis_fnc_instring)) || _x isequalto "") then {
_HitPointName = tolower _x;
if (!(_HitPointName in _repairs || _HitPointName in _replaces || (["glass",_HitPointName] call Bis_fnc_instring)) || _x isequalto "") then {
_repairarrays pushback [_foreachindex, 0];
};
} foreach ((getAllHitPointsDamage _veh) select 0);
Expand Down
Expand Up @@ -14,6 +14,7 @@
*/
private ["_secondlocalcheck","_repairarrays","_config","_VehicleRepairs","_reqiredMat","_searchname","_line","_returnmat"];
params ["_veh","_do","_hitpointname"];
_hitpointname = tolower _hitpointname;
_secondlocalcheck = false;
_returnmat = "";
_repairarrays = [];
Expand All @@ -33,11 +34,12 @@ switch _do do {
case 'repair': {
_reqiredMat = "";
_searchname = _hitpointname;
if (["glass",tolower _hitpointname] call Bis_fnc_instring) then {
if (["glass",_hitpointname] call Bis_fnc_instring) then {
_searchname = "glass";
};
{
_x params ["_name","","","_repairmat"];
_name = tolower _name;
if (_searchname isequalto _name) exitwith {
_reqiredMat = _repairmat;
};
Expand All @@ -64,11 +66,12 @@ switch _do do {
case 'replace': {
_reqiredMat = "";
_searchname = _hitpointname;
if (["glass",tolower _hitpointname] call Bis_fnc_instring) then {
if (["glass", _hitpointname] call Bis_fnc_instring) then {
_searchname = "glass";
};
{
_x params ["_name","","","","_replacemat"];
_name = tolower _name;
if (_searchname isequalto _name) exitwith {
_reqiredMat = _replacemat;
};
Expand Down Expand Up @@ -100,6 +103,7 @@ switch _do do {
_searchname = _hitpointname;
{
_x params ["_name","","","","_replacemat"];
_name = tolower _name;
if (_searchname isequalto _name) exitwith {
_returnmat = _replacemat;
};
Expand Down

0 comments on commit 3966ad7

Please sign in to comment.