From 811e06ffe241449afe95e85cc4c8b1c978940b6c Mon Sep 17 00:00:00 2001 From: Kobayashi Date: Sat, 24 Dec 2016 18:27:25 -0600 Subject: [PATCH] Detection of part doesn't work (#1828) For tanks and other vehicles not explicitly defined in configs, _part will return with "" using gettext(), evaluating if it is nil doesn't do anything. With this change it will properly allow for repairing tracks on tanks with scrap metal. --- SQF/dayz_code/actions/repair_vehicle.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SQF/dayz_code/actions/repair_vehicle.sqf b/SQF/dayz_code/actions/repair_vehicle.sqf index a2ddf688d..085255eca 100644 --- a/SQF/dayz_code/actions/repair_vehicle.sqf +++ b/SQF/dayz_code/actions/repair_vehicle.sqf @@ -17,7 +17,7 @@ _hitpoints = _vehicle call vehicle_getHitpoints; _configVeh = configFile >> "cfgVehicles" >> "RepairParts" >> _x; _part = getText(_configVeh >> "part"); - if (isNil "_part") then { _part = "PartGeneric"; }; + if ((isNil "_part") || (_part == "")) then { _part = "PartGeneric"; }; // get every damaged part no matter how tiny damage is! _damagePercent = str(round(_damage * 100))+"% Damage"; @@ -40,4 +40,4 @@ if (count _hitpoints > 0) then { _cancel = dayz_myCursorTarget addAction [localize "str_action_cancel_action", "\z\addons\dayz_code\actions\repair_cancel.sqf","repair", 0, true, false]; s_player_repairActions set [count s_player_repairActions,_cancel]; s_player_repair_crtl = 1; -}; \ No newline at end of file +};