CScriptPlatform: Simplify IsRider()

Same behavior, less code.
This commit is contained in:
Lioncash 2020-04-12 15:11:21 -04:00
parent fd5c6f9e59
commit c84f430852
1 changed files with 3 additions and 6 deletions

View File

@ -1,5 +1,7 @@
#include "Runtime/World/CScriptPlatform.hpp" #include "Runtime/World/CScriptPlatform.hpp"
#include <algorithm>
#include "Runtime/CStateManager.hpp" #include "Runtime/CStateManager.hpp"
#include "Runtime/Collision/CCollidableOBBTreeGroup.hpp" #include "Runtime/Collision/CCollidableOBBTreeGroup.hpp"
#include "Runtime/Collision/CGameCollision.hpp" #include "Runtime/Collision/CGameCollision.hpp"
@ -363,12 +365,7 @@ zeus::CAABox CScriptPlatform::GetSortingBounds(const CStateManager& mgr) const {
} }
bool CScriptPlatform::IsRider(TUniqueId id) const { bool CScriptPlatform::IsRider(TUniqueId id) const {
for (const SRiders& rider : x318_riders) { return std::any_of(x318_riders.cbegin(), x318_riders.cend(), [id](const auto& rider) { return rider.x0_uid == id; });
if (rider.x0_uid == id) {
return true;
}
}
return false;
} }
bool CScriptPlatform::IsSlave(TUniqueId id) const { bool CScriptPlatform::IsSlave(TUniqueId id) const {