ACE3/addons/repair/functions/fnc_getPatchWheelTime.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

26 lines
627 B
Plaintext

#include "script_component.hpp"
/*
* Author: Brett Mayson
* Calculate the time to patch the wheel
*
* Arguments:
* 0: Unit that does the patching <OBJECT>
* 1: Vehicle to patch <OBJECT>
* 2: Selected wheel hitpoint <STRING>
*
* Return Value:
* Patching time <NUMBER>
*
* Example:
* [unit, vehicle, "hitpoint"] call ace_repair_fnc_getPatchWheelTime
*
* Public: No
*/
params ["_unit", "_vehicle", "_hitPoint"];
// get current hitpoint damage
private _hitPointDamage = (_vehicle getHitPointDamage _hitPoint) - GVAR(patchWheelMaximumRepair);
ceil (_hitPointDamage / PATCH_WHEEL_STEP_TIME) * GVAR(patchWheelTime)