From 0d2e59435477b793e3825d663afa94a1ed9db87b Mon Sep 17 00:00:00 2001 From: GAMMACASE <31375974+GAMMACASE@users.noreply.github.com> Date: Fri, 8 Aug 2025 17:19:15 +0300 Subject: [PATCH] Correct CUtlRBTree::IsValidIndex --- public/tier1/utlrbtree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/tier1/utlrbtree.h b/public/tier1/utlrbtree.h index ba287375..0b1c7324 100644 --- a/public/tier1/utlrbtree.h +++ b/public/tier1/utlrbtree.h @@ -587,7 +587,7 @@ inline bool CUtlRBTree::IsValidIndex( I i ) const if ( !m_Elements.IsIdxValid( i ) ) return false; - if ( m_Elements.IsIdxAfter( i, m_LastAlloc ) ) + if ( m_Elements.IsIdxAfter( i, m_Elements.Count() - 1 ) ) return false; // don't read values that have been allocated, but not constructed return LeftChild(i) != i;