Skip to content

Commit

Permalink
Dragging - Fix dragging/carrying failing for items in ViV (#10128)
Browse files Browse the repository at this point in the history
* Unload ViV before dragging/carrying

* Update addons/dragging/functions/fnc_carryObject.sqf

Co-authored-by: PabstMirror <[email protected]>

* Use lazy eval to check if item was unloaded

---------

Co-authored-by: PabstMirror <[email protected]>
  • Loading branch information
johnb432 and PabstMirror authored Jul 20, 2024
1 parent 8ab36f6 commit 05ab1bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions addons/dragging/functions/fnc_carryObject.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
params ["_unit", "_target"];
TRACE_2("params",_unit,_target);

// If in ViV cargo, unload it first
// Warn user if it failed to unload (shouldn't happen)
if (!isNull isVehicleCargo _target && {!(objNull setVehicleCargo _target)}) then {
WARNING_1("ViV Unload Failed %1",_target);
};

// Get attachTo offset and direction
private _position = _target getVariable [QGVAR(carryPosition), [0, 0, 0]];
private _direction = _target getVariable [QGVAR(carryDirection), 0];
Expand Down
6 changes: 6 additions & 0 deletions addons/dragging/functions/fnc_dragObject.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
params ["_unit", "_target"];
TRACE_2("params",_unit,_target);

// If in ViV cargo, unload it first
// Warn user if it failed to unload (shouldn't happen)
if (!isNull isVehicleCargo _target && {!(objNull setVehicleCargo _target)}) then {
WARNING_1("ViV Unload Failed %1",_target);
};

// Get attachTo offset and direction.
private _position = _target getVariable [QGVAR(dragPosition), [0, 0, 0]];
private _direction = _target getVariable [QGVAR(dragDirection), 0];
Expand Down

0 comments on commit 05ab1bb

Please sign in to comment.