diff --git a/Runtime/CDependencyGroup.cpp b/Runtime/CDependencyGroup.cpp index c907be7fd..d6ee285fc 100644 --- a/Runtime/CDependencyGroup.cpp +++ b/Runtime/CDependencyGroup.cpp @@ -19,7 +19,7 @@ void CDependencyGroup::ReadFromStream(CInputStream& in) CFactoryFnReturn FDependencyGroupFactory(const SObjectTag& /*tag*/, CInputStream& in, const CVParamTransfer& /*param*/, CObjectReference* selfRef) { - return TToken::GetIObjObjectFor(std::unique_ptr(new CDependencyGroup(in))); + return TToken::GetIObjObjectFor(std::make_unique(in)); } } diff --git a/Runtime/Character/CCharacterFactory.cpp b/Runtime/Character/CCharacterFactory.cpp index c9bd29220..a75adf7cf 100644 --- a/Runtime/Character/CCharacterFactory.cpp +++ b/Runtime/Character/CCharacterFactory.cpp @@ -125,8 +125,8 @@ CCharacterFactory::CreateCharacter(int charIdx, bool loop, ({FourCC(drawInsts << 16), charInfo.GetModelId()}, charParm); rstl::optional_object> iceModel; - if (charInfo.GetIceModelId() != 0xffffffff && - charInfo.GetIceSkinRulesId() != 0xffffffff) + if (charInfo.GetIceModelId() != kInvalidResId && + charInfo.GetIceSkinRulesId() != kInvalidResId) iceModel.emplace(const_cast(this)->x70_cacheResPool.GetObj ({FourCC((drawInsts << 16) | 1), charInfo.GetIceModelId()}, charParm)); @@ -144,7 +144,7 @@ ResId CCharacterFactory::GetEventResourceIdForAnimResourceId(ResId id) const return id == elem.first; }); if (search == x58_animResources.cend()) - return -1; + return kInvalidResId; return search->second; } @@ -162,10 +162,7 @@ bool CCharacterFactory::HasAdditiveInfo(u32 idx) const { auto search = rstl::binary_find(x40_additiveInfo.cbegin(), x40_additiveInfo.cend(), idx, [](const auto& anim) { return anim.first; }); - - if (search == x40_additiveInfo.cend()) - return false; - return true; + return search != x40_additiveInfo.cend(); } std::vector diff --git a/Runtime/rstl.hpp b/Runtime/rstl.hpp index c8efe04ab..331e452d8 100644 --- a/Runtime/rstl.hpp +++ b/Runtime/rstl.hpp @@ -2,6 +2,7 @@ #define __RSTL_HPP__ #include +#include #include #include "optional.hpp"