Skip to content

Commit

Permalink
Поправил по совету @Graff46
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
xrSimpodin authored Mar 10, 2023
1 parent d9b9289 commit c56f935
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions ogsr_engine/xrGame/CarLights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

0 comments on commit c56f935

Please sign in to comment.