From 39f45eb855e5ec0c14ba434410e55bb7f8066d19 Mon Sep 17 00:00:00 2001 From: He-Man Date: Mon, 25 Sep 2017 19:04:24 +0200 Subject: [PATCH 1/2] Fix for Vehicle Maintainance --- .../EPOCH_client_VehicleMaintananceCheck.sqf | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/Sources/epoch_code/compile/vehicles/EPOCH_client_VehicleMaintananceCheck.sqf b/Sources/epoch_code/compile/vehicles/EPOCH_client_VehicleMaintananceCheck.sqf index 0ac47872..3b40ec4a 100644 --- a/Sources/epoch_code/compile/vehicles/EPOCH_client_VehicleMaintananceCheck.sqf +++ b/Sources/epoch_code/compile/vehicles/EPOCH_client_VehicleMaintananceCheck.sqf @@ -12,7 +12,7 @@ Github: https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/vehicles/EPOCH_client_VehicleMaintananceCheck.sqf */ -private ["_veh","_VehicleRepairs","_EnableRemoveParts","_repairs","_removes","_replaces","_wheels","_wheelcounter","_torepair","_HitPointName","_Hit","_wheel","_repairarrays"]; +private ["_veh","_VehicleRepairs","_EnableRemoveParts","_repairs","_removes","_replaces","_wheels","_wheelcounter","_HitPointName","_Hit","_wheel","_repairarrays"]; _veh = _this; _VehicleRepairs = ["CfgEpochClient", "VehicleRepairs", []] call EPOCH_fnc_returnConfigEntryV2; _EnableRemoveParts = ["CfgEpochClient", "EnableRemoveParts", true] call EPOCH_fnc_returnConfigEntryV2; @@ -24,7 +24,6 @@ if (_veh iskindof "ebike_epoch") then { _wheels = 2; }; _wheelcounter = 0; -_torepair = (getAllHitPointsDamage _veh) select 0; { _HitPointName = _x; _Hit = (getAllHitPointsDamage _veh) select 2 select _foreachindex; @@ -62,22 +61,14 @@ _torepair = (getAllHitPointsDamage _veh) select 0; } foreach _VehicleRepairs; } foreach ((getAllHitPointsDamage _veh) select 0); +_repairarrays = []; { - if (_x in _repairs || _x in _replaces) then { - _torepair = _torepair - [_x]; - } - else { - if (["glass",tolower _x] call Bis_fnc_instring) then { - _torepair = _torepair - [_x]; - }; + if (!(_x in _repairs || _x in _replaces || (["glass",tolower _x] call Bis_fnc_instring)) || _x isequalto "") then { + _repairarrays pushback [_foreachindex, 0]; }; } foreach ((getAllHitPointsDamage _veh) select 0); -if !(_torepair isequalto []) then { - _repairarrays = []; - { - _repairarrays pushback [_x,0]; - } foreach _torepair; +if !(_repairarrays isequalto []) then { if (local _veh) then { [_veh, _repairarrays] call EPOCH_client_repairVehicle; } else { @@ -85,4 +76,4 @@ if !(_torepair isequalto []) then { }; }; -EPOCH_VehicleRepairs = [_repairs,_removes,_replaces]; \ No newline at end of file +EPOCH_VehicleRepairs = [_repairs,_removes,_replaces]; From 0ddc7d638dab175f53d73e5fa324e62ec8afd0c1 Mon Sep 17 00:00:00 2001 From: He-Man Date: Mon, 25 Sep 2017 19:06:08 +0200 Subject: [PATCH 2/2] Fix for Vehicle Maintainance --- .../compile/vehicles/EPOCH_client_VehicleMaintananceDo.sqf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/epoch_code/compile/vehicles/EPOCH_client_VehicleMaintananceDo.sqf b/Sources/epoch_code/compile/vehicles/EPOCH_client_VehicleMaintananceDo.sqf index 0ab737b4..e3888807 100644 --- a/Sources/epoch_code/compile/vehicles/EPOCH_client_VehicleMaintananceDo.sqf +++ b/Sources/epoch_code/compile/vehicles/EPOCH_client_VehicleMaintananceDo.sqf @@ -108,6 +108,7 @@ switch _do do { ['Error - Could not find Return Material!',5] call Epoch_message; }; _repairarrays pushback [_hitpointname,1]; + _secondlocalcheck = true; }; }; @@ -129,4 +130,4 @@ if !(_repairarrays isequalto []) then { }; }; -EPOCH_Vehicle_MaintainLock = false; \ No newline at end of file +EPOCH_Vehicle_MaintainLock = false;