From c56f935929b69a30e33456e8908872cf53945efa Mon Sep 17 00:00:00 2001 From: xrSimpodin <16670637+xrSimpodin@users.noreply.github.com> Date: Fri, 10 Mar 2023 13:12:57 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BF=D0=BE=20=D1=81=D0=BE=D0=B2=D0=B5=D1=82=D1=83=20?= =?UTF-8?q?@Graff46?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [skip ci] --- ogsr_engine/xrGame/CarLights.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ogsr_engine/xrGame/CarLights.cpp b/ogsr_engine/xrGame/CarLights.cpp index c5da86b55e..e984efabd6 100644 --- a/ogsr_engine/xrGame/CarLights.cpp +++ b/ogsr_engine/xrGame/CarLights.cpp @@ -192,17 +192,24 @@ bool CCarLights::IsLight(u16 bone_id) } bool CCarLights::findLight(u16 bone_id, SCarLight*& light) { - LIGHTS_I i, e = m_lights.end(); SCarLight find_light; find_light.bone_id = bone_id; - i = std::find_if(m_lights.begin(), e, SFindLightPredicate(&find_light)); - light = *i; - return i != e; //-V783 + + auto e = m_lights.end(); + auto i = std::find_if(m_lights.begin(), e, SFindLightPredicate(&find_light)); + if (i != e) + { + light = *i; + return true; + } + else + return false; } + CCarLights::~CCarLights() { LIGHTS_I i = m_lights.begin(), e = m_lights.end(); for (; i != e; ++i) xr_delete(*i); m_lights.clear(); -} \ No newline at end of file +}