Describe the bug
When resetVehicleDummyPositions is called to restore exhaust positions, exhaust_second resets to 0, 0, 0 (the center of the vehicle) instead of its correct position.
resetVehicleDummyPositions resets exhaust_second to its model default, which for most vehicles is 0, 0, 0 since they only define a primary exhaust. The engine normally handles the secondary exhaust by negating the primary's X position at render time, but this implicit behaviour is bypassed when the dummy position is explicitly reset via script:
Steps to reproduce
local veh = getPedOccupiedVehicle(localPlayer)
setVehicleDummyPosition(veh, "exhaust_second", 0, 0, -5000) -- move it away
resetVehicleDummyPositions(veh) -- exhaust_second resets to 0, 0, 0 instead of mirrored exhaust position
local x, y, z = getVehicleDummyPosition(veh, "exhaust_second")
print(x, y, z) -- expected: mirrored exhaust X, actual: 0, 0, 0
Fix:
After calling resetVehicleDummyPositions, explicitly reposition exhaust_second by reading the primary exhaust's model position via getVehicleModelDummyPosition and negating its X: setVehicleDummyPosition(veh, "exhaust_second", -x, y, z).
Version
Multi Theft Auto v1.6-release-23952
Additional context
No response
Relevant log output
Security Policy
Describe the bug
When resetVehicleDummyPositions is called to restore exhaust positions, exhaust_second resets to 0, 0, 0 (the center of the vehicle) instead of its correct position.
resetVehicleDummyPositions resets exhaust_second to its model default, which for most vehicles is 0, 0, 0 since they only define a primary exhaust. The engine normally handles the secondary exhaust by negating the primary's X position at render time, but this implicit behaviour is bypassed when the dummy position is explicitly reset via script:
Steps to reproduce
Fix:
After calling resetVehicleDummyPositions, explicitly reposition exhaust_second by reading the primary exhaust's model position via getVehicleModelDummyPosition and negating its X: setVehicleDummyPosition(veh, "exhaust_second", -x, y, z).
Version
Multi Theft Auto v1.6-release-23952
Additional context
No response
Relevant log output
Security Policy