Skip to content

Commit 13d2e01

Browse files
committed
Fix particles related crash
Just use lambda instead.
1 parent f3e1f34 commit 13d2e01

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/xrGame/ParticlesPlayer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,7 @@ void CParticlesPlayer::AutoStopParticles(const shared_str& ps_name, u16 bone_id,
252252
pInfo->life_time = life_time;
253253
}
254254
}
255-
struct SRP
256-
{
257-
bool operator()(CParticlesPlayer::SParticlesInfo& pi) { return !pi.ps; }
258-
};
255+
259256
void CParticlesPlayer::UpdateParticles()
260257
{
261258
if (!m_bActiveBones)
@@ -299,7 +296,10 @@ void CParticlesPlayer::UpdateParticles()
299296
m_bActiveBones = true;
300297
}
301298

302-
auto RI = std::remove_if(b_info.particles.begin(), b_info.particles.end(), SRP());
299+
const auto RI = std::remove_if(b_info.particles.begin(), b_info.particles.end(), [](const SParticlesInfo& pi)
300+
{
301+
return pi.ps == nullptr;
302+
});
303303
b_info.particles.erase(RI, b_info.particles.end());
304304
}
305305
}

0 commit comments

Comments
 (0)