Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toggleControl next_weapon and previous_weapon takes sniper zoom with Q and A! #2275

Closed
mihayy5 opened this issue Jul 7, 2021 · 7 comments
Closed
Labels
bug Something isn't working

Comments

@mihayy5
Copy link

mihayy5 commented Jul 7, 2021

Describe the bug
Toggling next_weapon and previous_weapon controls off will also toggle sniper zoom off with Q and A keys!
Note: Mouse wheel will still zoom in/out
next_weapon = zoom_in & previous_weapon = zoom_out

To reproduce

  1. toggleControls off.
  2. Take sniper.
  3. Press Q or A to zoom in/out.
  4. Doesn't work.

Expected behaviour
Expected to zoom in or out depending on the key.

Version
Latest version from the MTA website: 1.5.8
Server: 1.5.8-9.20881.0
Client: v1.5.8-release-20881

@mihayy5 mihayy5 added the bug Something isn't working label Jul 7, 2021
@androksi
Copy link
Member

androksi commented Jul 7, 2021

I can confirm the issue.

@Allerek
Copy link
Contributor

Allerek commented Aug 12, 2021

Its most likely due to this check

if (bState || !GetMultiGTAControlState(pBind))

I'll check more about that later today.

@srslyyyy
Copy link
Contributor

If i recall correctly disabling jump won't let you zoom as well when holding LSHIFT.

@Allerek
Copy link
Contributor

Allerek commented Aug 13, 2021

if (pTemp->control->action == action)

^If we set the breakpoint here, with if statement to break only
"if action == ZOOM_IN"
and try to press Q, it wont break for some reason(breaks on if action == PREVIOUS_WEAPON). It looks like GTA Hardcoded 'NEXT/PREVIOUS Weapon' to ZOOM_IN/OUT.

Maybe we should make an IF statement with checking if player is using scope/zoom? Share your opinions.

@mihayy5
Copy link
Author

mihayy5 commented Aug 13, 2021

I'm not used to cpp, but in the line you shared there is this check that checks

if (action == action)

But where does actually 'action' get defined ?

@Allerek
Copy link
Contributor

Allerek commented Aug 13, 2021

I'm not used to cpp, but in the line you shared there is this check that checks

if (action == action)

But where does actually 'action' get defined ?

pTemp is temporary pointer to they keyBind that holds the same action as main key that was pressed, so ->action is its action, and

action is action of original key

eControllerAction action = pBind->control->action;

So this if statement is literally:
if temporaryKey have same action as action then proceed

@lopezloo
Copy link
Member

After 4a4bcbc it's no longer possible to control zoom using next_weapon / previous_weapon binds.

@lopezloo lopezloo closed this as not planned Won't fix, can't repro, duplicate, stale Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants