diff --git a/Runtime/Character/CBodyStateInfo.cpp b/Runtime/Character/CBodyStateInfo.cpp index 09325a628..a3a480127 100644 --- a/Runtime/Character/CBodyStateInfo.cpp +++ b/Runtime/Character/CBodyStateInfo.cpp @@ -8,7 +8,7 @@ namespace urde { CBodyStateInfo::CBodyStateInfo(CActor& actor, EBodyType type) { x34_24_changeLocoAtEndOfAnimOnly = false; const CPASDatabase& pasDatabase = actor.GetModelData()->GetAnimationData()->GetCharacterInfo().GetPASDatabase(); - for (int i = 0; i < pasDatabase.GetNumAnimStates(); ++i) { + for (size_t i = 0; i < pasDatabase.GetNumAnimStates(); ++i) { const CPASAnimState* state = pasDatabase.GetAnimStateByIndex(i); std::unique_ptr bs; diff --git a/Runtime/Character/CPASDatabase.hpp b/Runtime/Character/CPASDatabase.hpp index f6918b321..e06afeec4 100644 --- a/Runtime/Character/CPASDatabase.hpp +++ b/Runtime/Character/CPASDatabase.hpp @@ -23,7 +23,7 @@ public: std::pair FindBestAnimation(const CPASAnimParmData& data, s32 ignoreAnim) const; std::pair FindBestAnimation(const CPASAnimParmData& data, CRandom16& rand, s32 ignoreAnim) const; s32 GetDefaultState() const { return x10_defaultState; } - s32 GetNumAnimStates() const { return x0_states.size(); } + size_t GetNumAnimStates() const { return x0_states.size(); } const CPASAnimState* GetAnimState(s32 id) const { for (const CPASAnimState& state : x0_states) if (id == state.GetStateId()) @@ -31,11 +31,12 @@ public: return nullptr; } - const CPASAnimState* GetAnimStateByIndex(s32 index) const { - if (index < 0 || index >= x0_states.size()) + const CPASAnimState* GetAnimStateByIndex(size_t index) const { + if (index >= x0_states.size()) { return nullptr; + } - return &x0_states.at(index); + return &x0_states[index]; } bool HasState(s32 id) const {