This repository was archived by the owner on Apr 29, 2025. It is now read-only.
Fix paintType application for default and custom vehicle colors #753
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.
Previously, applying paintType1 and paintType2 (for Metallic, Matte, Chrome paint types) didn't work correctly.
Even when setting these values, the vehicle would ignore the desired paint type and fallback to default behavior (usually Metallic).
The issue was caused by improper handling of SetVehicleModColor_1/2, and a lack of distinction between custom RGB colors and default GTA color IDs. Also, it didn't properly clear custom colors when switching back to a stock paint ID.
This fix ensures that:
If color1 or color2 are numbers (GTA default colors), they are applied correctly and paintType is set properly.
If color1 or color2 are tables (custom RGB), they are used as custom colors and still apply paintType.
ClearVehicleCustomPrimaryColour and ClearVehicleCustomSecondaryColour are correctly used to avoid color conflicts.
Now the paintType properly changes the paint finish (Metallic, Matte, Chrome) as intended.