Closed GoverLabs closed 2 years ago
Fixed issues, specified at review
I just tested it and I think it still doesn't work correctly. For some vehicles (MULE, BENSON, MESAA, SUPERGT), extras are always disabled.
However, I will merge this PR now, and we can work on this later ...
I found one more copy-paste mistake, firstExtraIdx
is being assigned twice in SelectExtras()
. Sorry for that.
And yes, some vehicles really have disabled extras, and their CompRules are 0 in vehicles.ide. I will try to find out more, but until your comment I expected there should be a non-zero value for extra selection.
Alright, if you fix the issue, feel free to open another PR :)
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