Skip to content

Commit e9b75fd

Browse files
authored
editor: Fix EDF custom elements rotation issues on undo/manual Adjustment (#546)
* Fix EDF custom elements have wrong rotation * fix whitespaces
1 parent 83e2c79 commit e9b75fd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

[editor]/move_keyboard/move_keyboard.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,9 @@ function attachElement(element)
404404
posX, posY, posZ = getElementPosition(element)
405405
movementType = MOVEMENT_MOVE
406406

407+
-- Clear the quat rotation when attaching to element
408+
exports.editor_main:clearElementQuat(selectedElement)
409+
407410
if (getElementType(element) == "vehicle") or (getElementType(element) == "object") then
408411
rotX, rotY, rotZ = getElementRotation(element, "ZYX")
409412
elseif (getElementType(element) == "player") or (getElementType(element) == "ped") then
@@ -420,6 +423,9 @@ function detachElement()
420423
if (selectedElement) then
421424
disable()
422425

426+
-- Clear the quat rotation when detaching from element
427+
exports.editor_main:clearElementQuat(selectedElement)
428+
423429
-- fix for local elements
424430
if not isElementLocal(selectedElement) then
425431
-- sync position/rotation

0 commit comments

Comments
 (0)