diff --git a/src/features/lights/components/headlight.cpp b/src/features/lights/components/headlight.cpp index 38057e47..1d324cc6 100644 --- a/src/features/lights/components/headlight.cpp +++ b/src/features/lights/components/headlight.cpp @@ -62,11 +62,19 @@ bool HeadlightComponent::TryRegisterDummy(CVehicle* pVeh, RwFrame* pFrame, const c.corona.lightingType = eLightingMode::Directional; c.shadow.render = name != "headlights2"; - c.mirroredX = true; - data.dummies[eMaterialType::HeadLightLeft].push_back(VehicleDummy(c)); - - if (pVeh->m_nVehicleSubClass != VEHICLE_BIKE || std::abs(c.frame->modelling.pos.x) > 0.05f) { + bool isBike = (pVeh->m_nVehicleSubClass == VEHICLE_BIKE); + + if (isBike) { c.mirroredX = false; + c.lightType = eMaterialType::HeadLightLeft; + data.dummies[c.lightType].push_back(VehicleDummy(c)); + } else { + bool dummyIsLeft = (c.frame->modelling.pos.x < 0.0f); + c.mirroredX = !dummyIsLeft; + c.lightType = eMaterialType::HeadLightLeft; + data.dummies[eMaterialType::HeadLightLeft].push_back(VehicleDummy(c)); + + c.mirroredX = dummyIsLeft; c.lightType = eMaterialType::HeadLightRight; data.dummies[eMaterialType::HeadLightRight].push_back(VehicleDummy(c)); } diff --git a/src/features/lights/components/tail_light.cpp b/src/features/lights/components/tail_light.cpp index d9baf302..e96983d6 100644 --- a/src/features/lights/components/tail_light.cpp +++ b/src/features/lights/components/tail_light.cpp @@ -28,11 +28,19 @@ bool TailLightComponent::TryRegisterDummy(CVehicle* pVeh, RwFrame* pFrame, const c.shadow.size = LightsConfig::Get().gfTailLightShadowSize; c.corona.lightingType = eLightingMode::Directional; c.shadow.render = name != "taillights2"; - c.mirroredX = false; - data.dummies[c.lightType].push_back(VehicleDummy(c)); - - if (pVeh->m_nVehicleSubClass != VEHICLE_BIKE || std::abs(c.frame->modelling.pos.x) > 0.05f) { - c.mirroredX = true; + bool isBike = (pVeh->m_nVehicleSubClass == VEHICLE_BIKE); + + if (isBike) { + c.mirroredX = false; + c.lightType = eMaterialType::TailLightRight; + data.dummies[c.lightType].push_back(VehicleDummy(c)); + } else { + bool dummyIsLeft = (c.frame->modelling.pos.x < 0.0f); + c.mirroredX = dummyIsLeft; + c.lightType = eMaterialType::TailLightRight; + data.dummies[c.lightType].push_back(VehicleDummy(c)); + + c.mirroredX = !dummyIsLeft; c.lightType = eMaterialType::TailLightLeft; data.dummies[c.lightType].push_back(VehicleDummy(c)); }