2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 22:27:41 +00:00

Implement additive body states, rstl::binary_find

This commit is contained in:
Jack Andersen
2017-07-10 21:17:03 -10:00
parent 7e85ab932b
commit daef773f39
17 changed files with 371 additions and 71 deletions

View File

@@ -10,7 +10,8 @@ void CPlayerEnergyDrain::AddEnergyDrainSource(TUniqueId id, float intensity) { x
void CPlayerEnergyDrain::RemoveEnergyDrainSource(TUniqueId id)
{
auto it = std::lower_bound(x0_sources.begin(), x0_sources.end(), CEnergyDrainSource(id, 0.f));
auto it = rstl::binary_find(x0_sources.begin(), x0_sources.end(), id,
[](const CEnergyDrainSource& item) {return item.GetEnergyDrainSourceId();});
if (it != x0_sources.end())
x0_sources.erase(it);
}