multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.41k stars 438 forks source link

resetVehicleComponentPosition has issues with modded vehicles #3142

Open MrSol0 opened 1 year ago

MrSol0 commented 1 year ago

Describe the bug

Simply put, resetVehicleComponentPosition changes the component positions to the original GTA model when the vehicle is streamed in ( if the upgrade was added to the vehicle before getting replaced with a mod), while if used for a streamed out vehicle it works fine and resets components to the modded model's original component position. So i discovered this bug with resetVehicleComponentPosition after trying to make a tuneable truck, which requires me to use setComponentPosition to make the wheel upgrades work with this mod ( normal wheels are much wider and double, while upgrade wheels are tighter therefore i had to modify wheels component position (wheel_lf_dummy,wheel_lb_dummy,wheel_rb_dummy,wheel_rf_dummy) it more in ).

Steps to reproduce

1- Add a wheel upgrade to the truck before you load a mod on it, so with the default GTA model, , i'm using Linerunner 2- Replace the vehicle with the wheel upgrade with a mod using engineLoadDFF, engineReplaceModel 2- While the vehicle is streamedIn use resetVehicleComponentPosition to reset components such as wheel_lf_dummy,wheel_lb_dummy. 3- You will notice that the wheels has moved to the front like in this image. this is the issue https://i.ibb.co/tYMYwkW/Capture.png

NOTE: if you use resetVehicleComponentPosition with onClientElementStreamOut it will reset the wheel position to where it should be ( meaning the actual mod's component positions )

Version

No response

Additional context

No response

Relevant log output

No response

Security Policy

FileEX commented 1 year ago

Try with engineRestreamWorld function after loaded new model