2015-08-16 18:14:54 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Returns the damage threshold based on settings and unit type.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit that does the repairing <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* 0: Rpair Damage Threshold <NUMBER>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [unit] call ace_repair_fnc_getPostRepairDamage
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-04-22 19:01:22 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-09 06:54:44 +00:00
|
|
|
params ["_unit"];
|
|
|
|
TRACE_1("params",_unit);
|
2015-08-09 15:23:32 +00:00
|
|
|
// TODO when near repair station, full repair?
|
2015-08-09 16:08:53 +00:00
|
|
|
|
2015-08-14 19:36:54 +00:00
|
|
|
if (([_unit] call FUNC(isInRepairFacility) || {[_unit] call FUNC(isNearRepairVehicle)})) exitwith {0};
|
2015-08-09 16:08:53 +00:00
|
|
|
|
2015-04-22 19:01:22 +00:00
|
|
|
if ([_unit, GVAR(engineerSetting_Repair) + 1] call FUNC(isEngineer)) exitWith {GVAR(repairDamageThreshold_Engineer)};
|
|
|
|
if ([_unit, GVAR(engineerSetting_Repair)] call FUNC(isEngineer)) exitWith {GVAR(repairDamageThreshold)};
|
2015-08-09 15:23:32 +00:00
|
|
|
0.3;
|