ACE3/addons/repair/functions/fnc_getPostRepairDamage.sqf
PabstMirror ab769757d9 Skip Depends Hitpoints - Use HitPoints selPos for wheels
Stuff

Normalize Depends - Skip Glass Repair

Fix spawned wheel/track not having correct damage

getHitpointString robustness, hatchback fuelHitpoint, fix count errors

-

Formatting

local -> private

Fix Stuff
2015-11-20 21:11:50 -06:00

27 lines
747 B
Plaintext

/*
* 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
*/
#include "script_component.hpp"
params ["_unit"];
TRACE_1("params",_unit);
// TODO when near repair station, full repair?
if (([_unit] call FUNC(isInRepairFacility) || {[_unit] call FUNC(isNearRepairVehicle)})) exitWith {0};
if ([_unit, GVAR(engineerSetting_Repair) + 1] call FUNC(isEngineer)) exitWith {GVAR(repairDamageThreshold_Engineer)};
if ([_unit, GVAR(engineerSetting_Repair)] call FUNC(isEngineer)) exitWith {GVAR(repairDamageThreshold)};
0.3;