ACE3/addons/repair/functions/fnc_canPatchRemovedWheel.sqf
BrettMayson 10c1085aba
Repair - Add wheel patching (#8835)
* patch wheels on vehicles

* all tire patching working

Co-authored-by: mp-singh <mandeep@mandeepsingh.ca>

* doc

* remove unused string

* Update CfgVehicles.hpp

* use strintable

* setting for where the wheel can be patched

* localize

* Update stringtable.xml

* can't patch a missing tire

* removal > replacement

* Update addons/repair/initSettings.sqf

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* Apply suggestions from code review

Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* Apply suggestions from code review

Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>

* patch icon

* use PATCH_WHEEL_STEP_TIME

* fix wheel translation

---------

Co-authored-by: mp-singh <mandeep@mandeepsingh.ca>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>
Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
2023-06-28 13:39:08 +03:00

28 lines
810 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))