Skip to content

Commit

Permalink
Raise lower carry object (#5234)
Browse files Browse the repository at this point in the history
* Fix to move items up and down

* Fixed private

* Fixed public bug

* Inserted Pabst solution

* Remove extra space

* Fixed request + added author

* Fixed to correct comment

* Tweeked comment again
  • Loading branch information
Phyma authored and PabstMirror committed Jun 4, 2017
1 parent 8bb92ce commit cec82be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ nomisum <nomisum@gmail.com>
OnkelDisMaster <onkeldismaster@gmail.com>
oscarmolinadev
PaxJaromeMalues <seemax1991@gmail.com>
Phyma <sethramstrom@gmail.com>
pokertour
Professor <lukas.trneny@wo.cz>
rakowozz
Expand Down
8 changes: 6 additions & 2 deletions addons/dragging/functions/fnc_handleScrollWheel.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ _position set [2, ((_position select 2) + _scrollAmount min (_maxHeight + 1.5))

// move up/down object and reattach at current position
detach _carriedItem;
_carriedItem setPosATL _position;
_carriedItem attachTo [_unit];

// Uses this method of selecting position because setPosATL did not have immediate effect
private _positionChange = _position vectorDiff (getPosATL _carriedItem);
private _selectionPosition = _unit worldToModel (ASLtoAGL getPosWorld _carriedItem);
_selectionPosition = _selectionPosition vectorAdd _positionChange;
_carriedItem attachTo [_unit, _selectionPosition];

//reset the carry direction
private _direction = _carriedItem getVariable [QGVAR(carryDirection), 0];
Expand Down

0 comments on commit cec82be

Please sign in to comment.