CElitePirate: Simplify IsArmClawCollider()

We can collapse this down into a std::any_of call.
This commit is contained in:
Lioncash 2020-05-14 21:58:10 -04:00
parent c1f7358d96
commit d9540c31ce
1 changed files with 4 additions and 6 deletions

View File

@ -1,5 +1,8 @@
#include "Runtime/MP1/World/CElitePirate.hpp" #include "Runtime/MP1/World/CElitePirate.hpp"
#include <algorithm>
#include <array>
#include "Runtime/Camera/CFirstPersonCamera.hpp" #include "Runtime/Camera/CFirstPersonCamera.hpp"
#include "Runtime/Collision/CCollisionActor.hpp" #include "Runtime/Collision/CCollisionActor.hpp"
#include "Runtime/Collision/CCollisionActorManager.hpp" #include "Runtime/Collision/CCollisionActorManager.hpp"
@ -884,12 +887,7 @@ bool CElitePirate::IsArmClawCollider(std::string_view name, std::string_view loc
if (name == locator) { if (name == locator) {
return true; return true;
} }
for (size_t i = 0; i < infoCount; ++i) { return std::any_of(info, info + infoCount, [&name](const auto& entry) { return entry.from == name; });
if (name == info[i].from) {
return true;
}
}
return false;
} }
void CElitePirate::CreateGrenadeLauncher(CStateManager& mgr, TUniqueId uid) { void CElitePirate::CreateGrenadeLauncher(CStateManager& mgr, TUniqueId uid) {