Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theonPlayerInOut
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 theisPointInside
set tofalse
, but the previous callback function which is still running thewhile
loop is not aware of it, so it continues to run until the player pressesE
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 theOpen Bank
notification, but pressingE
does nothing. This happens, because thebreak
statement breaks thewhile
loop (which ends the listener forE
key) until you walk out of the zone and then back in.Questions: