#2525 - Add CanInteractWith checks for repair

This commit is contained in:
PabstMirror 2015-09-19 11:07:03 -05:00
parent 79d985a648
commit 3c93c2c95c
5 changed files with 9 additions and 1 deletions

View File

@ -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 = [];

View File

@ -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}

View File

@ -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 {

View File

@ -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 {

View File

@ -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};