2015-03-16 18:25:29 +00:00
|
|
|
// by commy2
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
private ["_unit", "_target"];
|
|
|
|
|
|
|
|
_unit = _this select 0 select 0;
|
|
|
|
_target = _this select 0 select 1;
|
|
|
|
|
2015-03-18 00:36:56 +00:00
|
|
|
if (
|
|
|
|
!([_unit] call EFUNC(common,isAlive)) // drop if the player is dead
|
|
|
|
|| {!([_target] call EFUNC(common,isAlive))} // drop if the crate is destroyed
|
|
|
|
|| {!(animationState _unit in DRAG_ANIMATIONS)} // drop if not in dragging anim. This also exits when entering a vehicle.
|
|
|
|
|| {currentWeapon _unit != primaryWeapon _unit}
|
|
|
|
|| {!([_unit] call EFUNC(common,isPlayer))}
|
|
|
|
) then {
|
2015-03-16 18:25:29 +00:00
|
|
|
[_unit, _target] call FUNC(dropObject);
|
|
|
|
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
|
|
|
};
|