Fix setVehicleDirtLevel
Describe the bug
https://wiki.multitheftauto.com/wiki/SetVehicleDirtLevel
Function has been disabled. Reason/Note: This function doesn't work actually. See the bugtracker for updates and more information.
Steps to reproduce
setVehicleDirtLevel (theVehicle, 100)
Version
Client: Multi Theft Auto v1.6-release-22279
Additional context
No response
Relevant log output
No response
Security Policy
- [X] I have read and understood the Security Policy and this issue is not security related.
Sadly, this function wont ever work without making our own implementation. Accrding to the gta wiki:
When accumulated dirt was introduced on vehicles in Grand Theft Auto: San Andreas, car washes were believed to be featured, but the feature was never included in the final version of the game
Thus we cannot call any gta function that sets the dirt level because such function doesn't exist.
Maybe CVehicleModelInfo::SetDirtTextures might do something but its unlikely anything will happen.
Maybe the dirt level can be recreated via textures?
Are you sure? Vehicles is SA can be dirty, but the game doesn't provide a way to clean them GTA SA 1.01 and silent path fix that.
Are you sure? Vehicles is SA can be dirty, but the game doesn't provide a way to clean them GTA SA 1.01 and silent path fix that.
With silent patch, yes. I looked over gta mem addresses but I didnt find any function that referenced or changed dirt level in any way.
gta-reversed has some related to dirt level code. There are documented and reversed functions.
gta-reversed has some related to dirt level code. There are documented and reversed functions.
No. The only functions related to dirt level are constructors for dirt textures but not to make car dirty. If it wasnt implemented in gta directly then it cannot be used. If it was introduced in silent patch then we could look at the changes and apply them to mta
No. The only functions related to dirt level are constructors for dirt textures but not to make car dirty.
I see a code related to dirt level changes. Vehicles in mta have dirt textures, but dirt level doesn't update them. It looks like there is 8 textures, but gta stucks with only one of them
I've talked about this with Silent a long time ago. I know that there is missing code in the CVehicleModelInfo::FindEditableMaterialListfunction (0x4C8490 some IDBs have it as ResetColors). This function is so short that it is inlined in CVehicleModelInfo::SetClump So Silent patch extends this function with the missing code (I don't know exactly what).
Maybe we can reimplement it while consulting stuff with Silent (assuming he's still active)?