Raise lower carry object (#5234)

* 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
This commit is contained in:
Phyma 2017-06-04 19:46:49 +02:00 committed by PabstMirror
parent 8bb92cee6f
commit cec82be93b
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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];