mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Dragging - Detect static weapon disassembled
Static weapons can still be disassembled at any time during dragging. This just adds a simple distance check and drops if object moves away from player.
This commit is contained in:
parent
8ed94e51f8
commit
146812b5e6
@ -14,8 +14,8 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
// drop if the crate is destroyed
|
||||
if !([_target] call EFUNC(common,isAlive)) then {
|
||||
// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
|
||||
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
|
||||
[_unit, _target] call FUNC(dropObject_carry);
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
@ -14,8 +14,8 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
// drop if the crate is destroyed
|
||||
if !([_target] call EFUNC(common,isAlive)) then {
|
||||
// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
|
||||
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
|
||||
[_unit, _target] call FUNC(dropObject);
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
@ -16,8 +16,8 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
// same as dragObjectPFH, checks if object is deleted or dead.
|
||||
if !([_target] call EFUNC(common,isAlive)) then {
|
||||
// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled))
|
||||
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
|
||||
[_unit, _target] call FUNC(dropObject);
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
@ -16,8 +16,8 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
// same as dragObjectPFH, checks if object is deleted or dead.
|
||||
if !([_target] call EFUNC(common,isAlive)) then {
|
||||
// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled))
|
||||
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
|
||||
[_unit, _target] call FUNC(dropObject);
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user