openmultiplayer / openmultiplayer/open.mp

syncRotation in AttachPlayerObjectToObject() has no effect

Open
#1,082 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
641
Forks
208
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
According to the documentation, the function AttachPlayerObjectToObject() has a parameter syncRotation, which defaults to true. However, I noticed that setting this parameter to false has no effect. If I'm interpreting the code correctly, the parameter isn't actually passed on, and in the implementation, it's always set to true.

To Reproduce
Link to Wiki
AttachPlayerObjectToObject(playerid, objectid, parentid, Float:offsetX, Float:offsetY, Float:offsetZ, Float:rotationX, Float:rotationY, Float:rotationZ, bool:syncRotation = true)

https://github.com/openmultiplayer/open.mp/blob/b4e4e99cada336252982be6a77ed4b08398301cd/Server/Components/Pawn/Scripting/Object/PlayerNatives.cpp#L56

https://github.com/openmultiplayer/open.mp/blob/master/Server/Components/Objects/object.hpp#L498

Expected behavior
Setting syncRotation has a effect.

Release version
Latest build

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Server/Components/Pawn/Scripting/Object/PlayerNatives.cpp around line 56 and trace syncRotation into Server/Components/Objects/object.hpp around line 498. Reproduce the linked AttachPlayerObjectToObject signature with syncRotation set to false, then verify that false changes rotation synchronization while the default true behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.