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.
This commit is contained in:
Kobayashi
2016-12-24 18:27:25 -06:00
committed by ebayShopper
parent 7e341739ee
commit 811e06ffe2

View File

@@ -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;
};
};