openmultiplayer / openmultiplayer/open.mp
[BUG]: Attachments get in the way while aiming
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 641
- Forks
- 208
- PR merge metrics
- No merged PRs in 30d
Description
Description
This is a known Attachments bug. It happens anytime you aim with a sniper, heat seeker, rocket launcher or camera. The attachments get in your way and you can barely see something unless you zoom-in.
Prior the Pawn.Raknet plugin, the most widely used work-around relied on the RemovePlayerAttachedObject native (it checked whatever the player was aiming with one of those weapons with OnPlayerKeyStateChange, it removed the attachments and set them back once the aiming key was released) which actually fixed the issue but it was quite bizarre since the changes were visible by other players as well.
This include, published on Burgershot forums too, corrected that behavior by hiding the attachment JUST for the player which is aiming by using Pawn.Raknet.
How to re-produce this bug
- Set an attachment like the one below;
SetPlayerAttachedObject(playerid, 0,19528,2,0.11,0.00,0.00,0.0,-6.0,0.0,1.06,1.20,0.91); - Aim with sniper, heat seeker, rocket launcher or camera.
open.mp server version
public beta build 1
Operating system or distribution
Windows 10
Contact information
ReshiramZekrom#7809
Additional information
I've reported this although I don't know whether it should be patched by the omp team or not. Patching it will mean fixing it for everybody and, while I believe it's an annoying issue, might there be someone which actually relies on this somehow or likes it the way as it is.
Since it can be easily fixed by simply including in the script the include linked above - which currently isn't working as, at the time I'm writing this, there are any omp natives to mess around with packets - it can even be left as it is.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduction steps and the linked attachment-fix.inc include to understand the intended aiming behavior. Then locate the open.mp attachment and aiming handling associated with SetPlayerAttachedObject and compare its visibility behavior with the include's player-only workaround. Done means attachments no longer obstruct the aiming player's view without changing what other players see.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100