diff --git a/Runtime/Character/CPASAnimState.cpp b/Runtime/Character/CPASAnimState.cpp index ca7f6e517..f0996e973 100644 --- a/Runtime/Character/CPASAnimState.cpp +++ b/Runtime/Character/CPASAnimState.cpp @@ -87,7 +87,7 @@ s32 CPASAnimState::PickRandomAnimation(CRandom16& rand) const { std::pair CPASAnimState::FindBestAnimation(const rstl::reserved_vector& parms, CRandom16& rand, s32 ignoreAnim) const { - const_cast*>(&x24_selectionCache)->clear(); + x24_selectionCache.clear(); float weight = -1.f; for (const CPASAnimInfo& info : x14_anims) { @@ -130,11 +130,11 @@ std::pair CPASAnimState::FindBestAnimation(const rstl::reserved_vect calcWeight = 1.0f; if (calcWeight > weight) { - const_cast*>(&x24_selectionCache)->clear(); - const_cast*>(&x24_selectionCache)->push_back(info.GetAnimId()); + x24_selectionCache.clear(); + x24_selectionCache.push_back(info.GetAnimId()); weight = calcWeight; } else if (weight == calcWeight) { - const_cast*>(&x24_selectionCache)->push_back(info.GetAnimId()); + x24_selectionCache.push_back(info.GetAnimId()); weight = calcWeight; } } diff --git a/Runtime/Character/CPASAnimState.hpp b/Runtime/Character/CPASAnimState.hpp index 8a26a5eb8..59701ba76 100644 --- a/Runtime/Character/CPASAnimState.hpp +++ b/Runtime/Character/CPASAnimState.hpp @@ -14,11 +14,11 @@ class CPASAnimState { s32 x0_id; std::vector x4_parms; std::vector x14_anims; - std::vector x24_selectionCache; + mutable std::vector x24_selectionCache; public: - CPASAnimState(CInputStream& in); - CPASAnimState(int stateId); + explicit CPASAnimState(CInputStream& in); + explicit CPASAnimState(int stateId); s32 GetStateId() const { return x0_id; } s32 GetNumAnims() const { return x14_anims.size(); } CPASAnimParm GetAnimParmData(s32, u32) const; diff --git a/Runtime/Character/CPASDatabase.hpp b/Runtime/Character/CPASDatabase.hpp index db97308b9..54545395c 100644 --- a/Runtime/Character/CPASDatabase.hpp +++ b/Runtime/Character/CPASDatabase.hpp @@ -18,7 +18,7 @@ class CPASDatabase { void SetDefaultState(s32 state) { x10_defaultState = state; } public: - CPASDatabase(CInputStream& in); + explicit CPASDatabase(CInputStream& in); std::pair FindBestAnimation(const CPASAnimParmData&, s32) const; std::pair FindBestAnimation(const CPASAnimParmData&, CRandom16&, s32) const; diff --git a/Runtime/Character/CPASParmInfo.hpp b/Runtime/Character/CPASParmInfo.hpp index c26c20e43..63b6db404 100644 --- a/Runtime/Character/CPASParmInfo.hpp +++ b/Runtime/Character/CPASParmInfo.hpp @@ -9,6 +9,7 @@ class CPASParmInfo { public: enum class EWeightFunction { ExactMatch, PercentError, AngularPercent, NoWeight }; +private: CPASAnimParm::EParmType x0_type; EWeightFunction x4_weightFunction; float x8_weight; @@ -16,7 +17,7 @@ public: CPASAnimParm::UParmValue x10_max; public: - CPASParmInfo(CInputStream& in); + explicit CPASParmInfo(CInputStream& in); CPASAnimParm::EParmType GetParameterType() const { return x0_type; } EWeightFunction GetWeightFunction() const { return x4_weightFunction; } float GetParameterWeight() const { return x8_weight; }