Skip to content

Commit

Permalink
Fix particles related crash
Browse files Browse the repository at this point in the history
Just use lambda instead.
  • Loading branch information
Xottab-DUTY committed Nov 4, 2017
1 parent f3e1f34 commit 13d2e01
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/xrGame/ParticlesPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,7 @@ void CParticlesPlayer::AutoStopParticles(const shared_str& ps_name, u16 bone_id,
pInfo->life_time = life_time;
}
}
struct SRP
{
bool operator()(CParticlesPlayer::SParticlesInfo& pi) { return !pi.ps; }
};

void CParticlesPlayer::UpdateParticles()
{
if (!m_bActiveBones)
Expand Down Expand Up @@ -299,7 +296,10 @@ void CParticlesPlayer::UpdateParticles()
m_bActiveBones = true;
}

auto RI = std::remove_if(b_info.particles.begin(), b_info.particles.end(), SRP());
const auto RI = std::remove_if(b_info.particles.begin(), b_info.particles.end(), [](const SParticlesInfo& pi)
{
return pi.ps == nullptr;
});
b_info.particles.erase(RI, b_info.particles.end());
}
}
Expand Down

0 comments on commit 13d2e01

Please sign in to comment.