Skip to content

Fix getElementAttachedOffsets returns radians instead of degrees#4726

Open
Xenius97 wants to merge 6 commits intomultitheftauto:masterfrom
Xenius97:fix/attach_getpos
Open

Fix getElementAttachedOffsets returns radians instead of degrees#4726
Xenius97 wants to merge 6 commits intomultitheftauto:masterfrom
Xenius97:fix/attach_getpos

Conversation

@Xenius97
Copy link
Contributor

Summary

This PR fixes getElementAttachedOffsets returns radians instead of degrees

Motivation/Info

Attempted to fix #4724 but when i restored original code (before #4680) first issue is the same, something else did break it cause in 1.6 works fine.

For some reason streaming doesn't uses the right angle when creating object on client side after reconnecting, getElementRotation and getElementPosition are returning correct position/angle on server side. If you're standing right to the object you will see in right angle, but after you reconnect it will be bugged again.

I don't know someone else did make changes in these, but i've reverted on local branch my changes and seems broken too.
image

For some reason getElementAttachedOffsets returns now radians:
image

gta_sa_8HnTvu7zTi.mp4

After this fix getElementAttachedOffsets returns the correct values but bug mentioned in #4724 still existing.
image

Test plan

local obj1 = createObject(1365, 0, 0, 3);
local obj2 = createObject(1337, 0, 0, 3);

-- setTimer(attachElements, 50, 1, obj2, obj1, -2, 0, 2, 10, 20, 30);
attachElements(obj2, obj1, -2, 0, 2, 10, 20, 30);

iprint(getElementPosition(obj2));
iprint(getElementRotation(obj2));

setTimer(function()
    iprint(getElementAttachedOffsets(obj2));
end, 200, 1);

Checklist

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.

@Xenius97 Xenius97 requested a review from a team as a code owner February 24, 2026 23:15
@FileEX
Copy link
Member

FileEX commented Feb 24, 2026

What about client side?

@FileEX FileEX added the bugfix Solution to a bug of any kind label Feb 24, 2026
@Xenius97
Copy link
Contributor Author

What about client side?

client has no issues

@FileEX
Copy link
Member

FileEX commented Feb 25, 2026

Hmm, personally I think it would be better to determine the cause of this change and where it occurred, since this is a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Solution to a bug of any kind

Projects

None yet

Development

Successfully merging this pull request may close these issues.

attaching elements inconsistent and broken in 1.7

2 participants