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

Motorcycles and bicycles taken out of the garage are unable to be unlocked. #114

Closed
andreutu opened this issue Aug 30, 2024 · 4 comments
Closed
Labels
bug Something isn't working need repro This bug report needs confirmation

Comments

@andreutu
Copy link

Summary

Bikes cannot be unlocked when they are taken out of a garage.

Reproduction

  1. Own a motorcycle / bicycle (if not, buy one from a dealership, then store it).
  2. Take it out of a garage.

NOTE: In qbx_garages, the config option doorsLocked must be set to true.

Expected behavior

The vehicle should be unlocked upon taken out, while other vehicles, like cars, for example, should be locked, considering doorsLocked is true in qbx_garage's config.

Actual behavior

The motorcycle/bicycle is locked. The owner can't get in the vehicle, and it can't be unlocked due to qbx_vehiclekeys preventing bikes to lock/unlock.

Additional context

I have tried to open a pull request for qbx_garages that adds a config option for vehicle classes that won't be locked upon taken out, but I have been informed that this is not a needed feature. I will link this PR down below.

Qbox-project/qbx_garages#121

Current Version

v1.0.0, latest commit: 91778f2

Custom Resources

None that interfere with this.

@andreutu andreutu added bug Something isn't working need repro This bug report needs confirmation labels Aug 30, 2024
@Manason
Copy link
Member

Manason commented Aug 30, 2024

So the root of the issue is a conflict between qbx_vehiclekeys and qbx_garages. qbx_garages uses the native to lock vehicles by default, assuming that all vehicles should have locks. However qbx_vehiclekeys makes some vehicles not have a lock like bikes.

qbx_garages seems wrong to blindly lock any vehicle being spawned. qbx_vehiclekeys is the source of truth on which vehicles have locks and which do not. Some possible solutions:

  1. modify qbx_garages to add a dependency on qbx_vehiclekeys, and do the locking through API call which will exempt the same vehicles that qbx_vehiclekeys exempts
  2. remove the feature from qbx_garages altogether; instead trigger an event that qbx_vehiclekeys can consume to lock the vehicle, putting business logic of what to do when a vehicle is spawned from a garage on qbx_vehiclekeys.

The choice here comes down to whether garages should depend on vehiclekeys or whether vehiclekeys should depend on garages. I lean towards number 1 as it is the same solution we used in core.

@artur-michalak
Copy link
Contributor

I can additionally add a workaround to qbx_vehiclekeys, which allows you to unlock vehicles that are always unlocked in the configuration

@Manason
Copy link
Member

Manason commented Aug 30, 2024

I can additionally add a workaround to qbx_vehiclekeys, which allows you to unlock vehicles that are always unlocked in the configuration

While that would help, this bug still exists where vehicles that aren't supposed to have locks spawned locked because a different resource is doing so bypassing qbx_vehiclekeys. I think the best thing to do is to update qbx_garages to check if qbx_vehiclekeys is running and if so, to call it to lock rather than native.

@Manason
Copy link
Member

Manason commented Oct 26, 2024

Closing since this doesn't require changes to qbx_vehiclekeys

@Manason Manason closed this as not planned Won't fix, can't repro, duplicate, stale Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need repro This bug report needs confirmation
Projects
Status: Done
Development

No branches or pull requests

3 participants