mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #2529 from acemod/repairCanInteractCheck
Add CanInteractWith checks for repair
This commit is contained in:
commit
8279f60d09
@ -20,6 +20,8 @@
|
||||
private ["_hitpointGroupConfig", "_hitpointGroup", "_postRepairDamage", "_return"];
|
||||
params ["_caller", "_target", "_hitPoint"];
|
||||
|
||||
if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
|
||||
// Get hitpoint groups if available
|
||||
_hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hitpointGroups);
|
||||
_hitpointGroup = [];
|
||||
|
@ -20,4 +20,6 @@
|
||||
params ["_unit", "_target", "_hitPoint"];
|
||||
TRACE_3("params",_unit,_target,_hitPoint);
|
||||
|
||||
if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
|
||||
alive _target && {_target getHitPointDamage _hitPoint < 1}
|
||||
|
@ -21,6 +21,8 @@ params ["_unit", "_target", "_hitPoint", ["_wheel",false]];
|
||||
TRACE_4("params",_unit,_target,_hitPoint,_wheel);
|
||||
// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action
|
||||
|
||||
if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
|
||||
if (typeName _wheel == "OBJECT") then {
|
||||
// not near interpret as objNull
|
||||
if !(_wheel in nearestObjects [_unit, ["ACE_Track"], 5]) then {
|
||||
|
@ -22,6 +22,8 @@ params ["_unit", "_target", "_hitPoint", ["_track", false]];
|
||||
TRACE_4("params",_unit,_target,_hitPoint,_track);
|
||||
// TODO [_unit, _track] call EFUNC(common,claim); on start of action
|
||||
|
||||
if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
|
||||
if (typeName _track == "OBJECT") then {
|
||||
// not near interpret as objNull
|
||||
if !(_track in nearestObjects [_unit, ["ACE_Track"], 5]) then {
|
||||
|
@ -23,7 +23,7 @@ TRACE_4("params",_unit,_target,_hitPoint,_wheel);
|
||||
// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action
|
||||
//if !([_unit, _target, _hitpoint, "ReplaceWheel"] call FUNC(canRepair)) exitwith {false};
|
||||
|
||||
//if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
|
||||
//if !([_unit, GVAR(engineerSetting_Wheel)] call FUNC(isEngineer)) exitWith {false};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user