ACE3/addons/repair/functions/fnc_canPatchRemovedWheel.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

28 lines
813 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: commy2, Brett Mayson
* Check if the unit can patch a wheel not on a vehicle.
*
* Arguments:
* 0: Unit that does the patching <OBJECT>
* 1: Wheel to patch <OBJECT>
*
* Return Value:
* Can patch wheel? <BOOL>
*
* Example:
* [unit, vehicle] call ace_repair_fnc_canPatchRemovedWheel
*
* Public: No
*/
params ["_unit", "_target"];
TRACE_2("params",_unit,_target);
if (GVAR(patchWheelEnabled) == -1) exitWith {false};
if !("ground" in GVAR(patchWheelLocation)) exitWith {false};
if ((GVAR(patchWheelRequiredItems) isEqualTo [ANY_TOOLKIT_FAKECLASS]) && {!([_unit, [GVAR(allToolKits)]] call FUNC(hasItems))}) exitWith {false};
if !([_unit, GVAR(patchWheelEnabled)] call FUNC(isEngineer)) exitWith {false};
(damage _target > GVAR(patchWheelMaximumRepair))