mirror of
https://github.com/acemod/ACE3.git
synced 2025-07-25 12:52:41 +00:00
Fix for vehicles returning empty array with getAllHitPointsDamage
This commit is contained in:
@ -87,7 +87,7 @@ class ACE_Repair {
|
||||
requiredEngineer = QGVAR(engineerSetting_fullRepair);
|
||||
repairLocations[] = {QGVAR(fullRepairLocation)};
|
||||
repairingTime = QFUNC(getFullRepairTime);
|
||||
condition = "((getAllHitPointsDamage _target) select 2) findIf {_x > 0} != -1";
|
||||
condition = QFUNC(canFullRepair);
|
||||
callbackSuccess = QFUNC(doFullRepair);
|
||||
callbackProgress = QFUNC(fullRepairProgress);
|
||||
items = QGVAR(fullRepairRequiredItems);
|
||||
|
@ -9,6 +9,7 @@ PREP(canRepair);
|
||||
PREP(canRepairTrack);
|
||||
PREP(canReplaceTrack);
|
||||
PREP(canReplaceWheel);
|
||||
PREP(canFullRepair);
|
||||
PREP(doFullRepair);
|
||||
PREP(doPatchWheelProgress);
|
||||
PREP(doRemoveTrack);
|
||||
|
33
addons/repair/functions/fnc_canFullRepair.sqf
Normal file
33
addons/repair/functions/fnc_canFullRepair.sqf
Normal file
@ -0,0 +1,33 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: Ivanowicz
|
||||
* Check if vehicle has non-empty hitpoint damage array and if any of the hitpoints has damage.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Can Full Repair <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle] call ace_repair_fnc_canFullRepair
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_unit", "_target"];
|
||||
TRACE_2("params",_unit,_target);
|
||||
|
||||
private _return = false;
|
||||
|
||||
if ((getAllHitPointsDamage _target) isNotEqualTo []) then {
|
||||
if (((getAllHitPointsDamage _target) select 2) findIf {_x > 0} != -1) then {
|
||||
_return = true;
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user