Skip to content

Commit

Permalink
isRepairVehicle handling for bool and int
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuel authored Apr 16, 2018
1 parent 7239ad5 commit 74f5b99
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion addons/repair/functions/fnc_isRepairVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ TRACE_1("params",_vehicle);

if (_vehicle isKindOf "CAManBase") exitWith {false};

((_vehicle getVariable ["ACE_isRepairVehicle", getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(canRepair))]) > 0);
// Backwards compability due to wiki saying isRepairVehicle was a boolean, this function only checked for an integer value.
private _value = _vehicle getVariable ["ACE_isRepairVehicle", -1];
if (_value in [0, false]) exitWith {false};
if (_value isEqualTo true || {value > 0}) exitWith {true};
getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(canRepair)) > 0 // return

0 comments on commit 74f5b99

Please sign in to comment.