-
Notifications
You must be signed in to change notification settings - Fork 180
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
Update character.lua #665
base: main
Are you sure you want to change the base?
Update character.lua #665
Conversation
Fixed a Black Screen Issue: Resolved an issue where players encountered a black screen when creating an identity with "starting apartments" enabled.
--- @param resourceName string The name of the resource to check. | ||
--- @return boolean True if the resource is missing, false otherwise. | ||
local function isResourceMissing(resourceName) | ||
return GetResourceState(resourceName) == 'missing' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if resource is stopped
, uninitialized
or any other state, would be better just ~= 'started'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also no real need to make that a function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if resource is
stopped
,uninitialized
or any other state, would be better just~= 'started'
Even better I did not check that qbx_apartments is achieved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also no real need to make that a function
It's user friendly for people who don't know a lot, and as u can see on the discord there are multiple people with the black screen issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isResourceMissing(qbx_spawn)
says the exact same thing as GetResourceState('qbx_spawn') == 'missing'
. It's unneeded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind, but I think since we're already using GetResourceState with its method in the same file, we should just continue using it so GetResourceState('qbx_spawn'):find('start')
would be better.
Fixed a Black Screen Issue: Resolved an issue where players encountered a black screen when creating an identity with "starting apartments" enabled.
Description
This pull request introduces the following improvements:
Bug Fix: Added a fallback mechanism to handle cases where required resources (qbx_spawn or qbx_apartments) are missing. If a resource is unavailable, the system defaults to spawnDefault, preventing the black screen issue.
Code Refactor: Encapsulated the spawn logic into a modular and reusable function. This improves readability, maintainability, and makes the codebase easier to extend in the future.
Inline Documentation: Added LuaDoc comments to describe function parameters, return types, and key logic flows. This helps other developers quickly understand the purpose and usage of the code.
Checklist