Skip to content

Fixed callback does not exist error#732

Open
LumaNodeStudios wants to merge 1 commit intoQbox-project:mainfrom
LumaNodeStudios:main
Open

Fixed callback does not exist error#732
LumaNodeStudios wants to merge 1 commit intoQbox-project:mainfrom
LumaNodeStudios:main

Conversation

@LumaNodeStudios
Copy link

Description

This PR fixes the client error of the "qbx_core:server:getVehiclesToSpawn" callback not existing if the "qbx:vehiclePersistenceType" convar is not set to "full"

Checklist

  • I have personally loaded this code into an updated Qbox project and checked all of its functionality.
  • My pull request fits the contribution guidelines & code conventions.

@realgeneraliroh
Copy link
Contributor

Why is the guard clause not in the event handler?

@LumaNodeStudios
Copy link
Author

Why is the guard clause not in the event handler?

I'm not sure I see the benefit of registering the OnPlayerLoaded and removeVehZone event handlers if the persistence convar isn't set to full. Is there a specific reason they need to be registered even when they won't execute any logic?

@realgeneraliroh
Copy link
Contributor

Why is the guard clause not in the event handler?

I'm not sure I see the benefit of registering the OnPlayerLoaded and removeVehZone event handlers if the persistence convar isn't set to full. Is there a specific reason they need to be registered even when they won't execute any logic?

That makes sense. I had not fully analyzed the logic, yet. But now looking at it, you are right. The last two functions are unneeded, if the server is not in full mode. Just looks a bit "odd" to me, with the guard clause sitting out on its lonesome. Haha

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