fix(model): correct binary search behavior in CM2Model::FindKey

This commit is contained in:
fallenoak 2025-12-25 22:19:48 -06:00
parent a72ba6f154
commit 46e5611630
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D

View File

@ -950,7 +950,7 @@ void CM2Model::FindKey(M2ModelBoneSeq* sequence, const M2TrackBase& track, uint3
// Perform binary search for key containing sequence time // Perform binary search for key containing sequence time
int32_t lowKey = 0; int32_t lowKey = 0;
int32_t highKey = numKeys; int32_t highKey = numKeys - 1;
while (lowKey < highKey) { while (lowKey < highKey) {
int32_t midKey = (lowKey + highKey) / 2; int32_t midKey = (lowKey + highKey) / 2;