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

🐛 Fix banking interaction zone #147

Merged

Conversation

NewtyMan
Copy link
Contributor

@NewtyMan NewtyMan commented Nov 18, 2024

Description

This PR introduces a fix for the following issue #144.

This problem appears/happens when the resource is configured to not use qb-target, but instead uses the zones to determine whether the player can open the bank or not.

This bug occurs, because currently the while loop inside the onPlayerInOut callback conditions the local variable instead of a global one. This means that when the player leaves, a new event is fired (new callback function executed) which has the isPointInside set to false, but the previous callback function which is still running the while loop is not aware of it, so it continues to run until the player presses E for the first time.

I also removed the break statement on line 210, since it was causing another issue/bug. This bug is that if you close the banking window, you needed to walk out of the banking zone and back in, if you want to open the window again. If you do not walk out, you still have the Open Bank notification, but pressing E does nothing. This happens, because the break statement breaks the while loop (which ends the listener for E key) until you walk out of the zone and then back in.

Questions:

  • Have you personally loaded this code into an updated qbcore project and checked all it's functionality?
  • Does your code fit the style guidelines?
  • Does your PR fit the contribution guidelines?

@GhzGarage GhzGarage merged commit 9e2991a into qbcore-framework:main Nov 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants