From 7ee92ad2779691e98651d30aa624c598397cbb87 Mon Sep 17 00:00:00 2001 From: Federico Romero Date: Thu, 11 Jun 2026 20:39:01 -0300 Subject: [PATCH] Fix getVehicleDummyPosition returning 0,0,0 for the mirrored second exhaust Most vehicle models have no second exhaust dummy, in which case the game mirrors the primary exhaust on the X axis when placing exhaust and nitro effects (a fallback MTA's dummy hooks replicate). getVehicleDummyPosition returned the raw stored value instead, so "exhaust_second" reported 0, 0, 0 - vehicle centre - while the effects visibly appeared at the mirrored position, e.g. after resetVehicleDummyPositions. Apply the same fallback in the getter so the reported position matches the effective one. Fixes #4761 --- Client/mods/deathmatch/logic/CClientVehicle.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Client/mods/deathmatch/logic/CClientVehicle.cpp b/Client/mods/deathmatch/logic/CClientVehicle.cpp index b26486838b6..af916f2f00c 100644 --- a/Client/mods/deathmatch/logic/CClientVehicle.cpp +++ b/Client/mods/deathmatch/logic/CClientVehicle.cpp @@ -5076,13 +5076,21 @@ CVehicleAudioSettingsEntry& CClientVehicle::GetOrCreateAudioSettings() bool CClientVehicle::GetDummyPosition(VehicleDummies dummy, CVector& position) const { - if (dummy >= VehicleDummies::LIGHT_FRONT_MAIN && dummy < VehicleDummies::VEHICLE_DUMMY_COUNT) + if (dummy < VehicleDummies::LIGHT_FRONT_MAIN || dummy >= VehicleDummies::VEHICLE_DUMMY_COUNT) + return false; + + position = m_dummyPositions[(std::size_t)dummy]; + + // Most models have no second exhaust dummy, in which case the game mirrors the primary + // exhaust on the X axis (see ApplyExhaustParticlesPosition). Reflect that here, so the + // reported position matches where the effects actually appear + if (dummy == VehicleDummies::EXHAUST_SECONDARY && position == CVector()) { - position = m_dummyPositions[(std::size_t)dummy]; - return true; + position = m_dummyPositions[(std::size_t)VehicleDummies::EXHAUST]; + position.fX = -position.fX; } - return false; + return true; } bool CClientVehicle::SetDummyPosition(VehicleDummies dummy, const CVector& position)