-
-
Notifications
You must be signed in to change notification settings - Fork 17
Add nil guards and verbose warnings for MyVehicleConfig across client modules #59
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
base: preview
Are you sure you want to change the base?
Conversation
Co-authored-by: Flohhhhh <48927090+Flohhhhh@users.noreply.github.com>
Co-authored-by: Flohhhhh <48927090+Flohhhhh@users.noreply.github.com>
Co-authored-by: Flohhhhh <48927090+Flohhhhh@users.noreply.github.com>
Flohhhhh
left a comment
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.
Looks good, but let's be slightly more verbose overall, for example i think we really should never be calling a lot of these things at all when MyVehicleConfig is nil
It would be nice to log some sort of warning in case we try to do something we shouldn't.
…icleConfig Co-authored-by: Flohhhhh <48927090+Flohhhhh@users.noreply.github.com>
Added verbose warning messages to all internal functions and event handlers that shouldn't be called when MyVehicleConfig is nil. Now functions like setBrakeExtras, setCruiseLights, onDoorStateChange, setReverseExtras, and others will log clear warnings if they're inappropriately called without a valid configuration. (commit 1f53b15) |
Co-authored-by: Flohhhhh <48927090+Flohhhhh@users.noreply.github.com>
When external
ulc.luafiles contain syntax errors, server-side loading fails andMyVehicleConfigremains nil, causing cascading client-side errors when attempting to access its properties.Changes
MyVehicleConfigproperties in all 9 client modules (buttons, stages, brake, horn, park, cruise, signals, doors, reverse)Example
Script continues running when configs fail to load instead of producing repeated uncaught errors. Warning messages help identify when functions are being called in invalid states, making debugging easier.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.