Implemented extra components selection for vehicles #135
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.
As was noted at #86 , some vehicles have extra componets, which are being selected by a few different rules. Since the original impementations of those tricky rules used some bit operations, I used this a reversed implementation as a cheat-sheet (see
::ChooseComponent
method at gta_reversedNow it works fine, and selects extra compontents according to rules explained in the topic: https://gtaforums.com/topic/530575-tutcomponent-rules/
The only exception is that rules should also consider current weather, which is not currenty implemented in the project.
As a possible improvement
int
can be replaced bybytes
in my union-like struct, to save some memory. Unfortunately, I found no obvious way to work with separate 4 bits in C#, only with bytes, which are not really useful to parse values like 2ff0