2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-06-24 11:53:29 +00:00

CArtifactDoll: Collapse loop into std::all_of

Same thing, but directly stores to a variable.
This commit is contained in:
Lioncash 2019-10-21 19:40:22 -04:00
parent 7a8edc8d5e
commit c4ad797953

View File

@ -164,12 +164,15 @@ void CArtifactDoll::Touch() {
}
bool CArtifactDoll::CheckLoadComplete() {
if (IsLoaded())
if (IsLoaded()) {
return true;
}
for (TLockedToken<CModel>& model : x0_models)
if (!model.IsLoaded())
return false;
const bool allLoaded =
std::all_of(x0_models.cbegin(), x0_models.cend(), [](const auto& model) { return model.IsLoaded(); });
if (!allLoaded) {
return false;
}
x28_24_loaded = true;
return true;