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