Skip to content

resetVehicleDummyPositions causing exhaust_second dummy to reset to the incorrect position #4761

@Vampiiree

Description

@Vampiiree

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:

Image

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

  • I have read and understood the Security Policy and this issue is not security related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions