Reenable collision on drop, Update function headers

This commit is contained in:
jonpas 2016-10-28 14:20:39 +02:00
parent e400a68427
commit 8bfcb5a1b1
2 changed files with 12 additions and 5 deletions

View File

@ -7,13 +7,14 @@
* 0: Unit <OBJECT>
* 1: Target <OBJECT>
* 2: Start time <NUMBER>
* 3: Disabled Collision Objects <ARRAY> (empty for in-PFH changes)
* 1: PFEH Id <NUMBER>
*
* Return Value:
* None
*
* Example:
* [[player, target], 20] call ace_dragging_fnc_carryObjectPFH;
* [[player, target, []], 20] call ace_dragging_fnc_carryObjectPFH;
*
* Public: No
*/
@ -39,7 +40,7 @@ if (!alive _target || {_unit distance _target > 10}) then {
//so wait a full second to exit if out of range (this is critical as we would otherwise detach and set it's pos to weird pos)
TRACE_3("ignoring bad distance at start",_unit distance _target,_startTime,CBA_missionTime);
};
[_unit, _target] call FUNC(dropObject_carry);
[_unit, _target, _disabledCollisionObjects] call FUNC(dropObject_carry);
[_idPFH] call CBA_fnc_removePerFrameHandler;
};

View File

@ -5,19 +5,20 @@
* Arguments:
* 0: Unit that carries the other object <OBJECT>
* 1: Carried object to drop <OBJECT>
* 2: Disabled Collision Objects <ARRAY>
*
* Return Value:
* None
*
* Example:
* [player, cursorTarget] call ace_dragging_fnc_dropObject_carry;
* [player, cursorTarget, [p1, p2]] call ace_dragging_fnc_dropObject_carry;
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit", "_target"];
TRACE_2("params",_unit,_target);
params ["_unit", "_target", "_disabledCollisionObjects"];
TRACE_1("params",_this);
// remove drop action
[_unit, "DefaultAction", _unit getVariable [QGVAR(ReleaseActionID), -1]] call EFUNC(common,removeActionEventHandler);
@ -75,3 +76,8 @@ if !(_target isKindOf "CAManBase") then {
if (_target getVariable [QGVAR(isUAV), false]) then {
createVehicleCrew _target;
};
// Reenable collision with nearby objects
{
_target enableCollisionWith _x;
} forEach _disabledCollisionObjects;