From c84f430852697d21e7ecd749957dd1076f129d6e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 12 Apr 2020 15:11:21 -0400 Subject: [PATCH] CScriptPlatform: Simplify IsRider() Same behavior, less code. --- Runtime/World/CScriptPlatform.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Runtime/World/CScriptPlatform.cpp b/Runtime/World/CScriptPlatform.cpp index cebbf646b..2297bb12e 100644 --- a/Runtime/World/CScriptPlatform.cpp +++ b/Runtime/World/CScriptPlatform.cpp @@ -1,5 +1,7 @@ #include "Runtime/World/CScriptPlatform.hpp" +#include + #include "Runtime/CStateManager.hpp" #include "Runtime/Collision/CCollidableOBBTreeGroup.hpp" #include "Runtime/Collision/CGameCollision.hpp" @@ -363,12 +365,7 @@ zeus::CAABox CScriptPlatform::GetSortingBounds(const CStateManager& mgr) const { } bool CScriptPlatform::IsRider(TUniqueId id) const { - for (const SRiders& rider : x318_riders) { - if (rider.x0_uid == id) { - return true; - } - } - return false; + return std::any_of(x318_riders.cbegin(), x318_riders.cend(), [id](const auto& rider) { return rider.x0_uid == id; }); } bool CScriptPlatform::IsSlave(TUniqueId id) const {