From f8b8fe219ba4cc9c8d59c91b2f5cc2d93a060528 Mon Sep 17 00:00:00 2001 From: GAMMACASE <31375974+GAMMACASE@users.noreply.github.com> Date: Mon, 7 Oct 2024 01:33:33 +0300 Subject: [PATCH] Update CEntityKeyValues --- public/entity2/concreteentitylist.h | 2 +- public/entity2/entitykeyvalues.h | 2 +- public/entity2/entitysystem.h | 4 +++- public/tier1/utlleanvector.h | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/public/entity2/concreteentitylist.h b/public/entity2/concreteentitylist.h index 0274ee76..1cead58c 100644 --- a/public/entity2/concreteentitylist.h +++ b/public/entity2/concreteentitylist.h @@ -9,7 +9,7 @@ class CConcreteEntityList { CEntityIdentity* m_pHead; CEntityIdentity* m_pTail; - uint64 unk; + int m_nCount; }; public: CEntityIdentity* m_pIdentityChunks[MAX_ENTITY_LISTS]; diff --git a/public/entity2/entitykeyvalues.h b/public/entity2/entitykeyvalues.h index 08e84902..f54af6bb 100644 --- a/public/entity2/entitykeyvalues.h +++ b/public/entity2/entitykeyvalues.h @@ -194,7 +194,7 @@ private: int16 m_nQueuedForSpawnCount; bool m_bAllowLogging; EntityKVAllocatorType_t m_eAllocatorType; - CUtlLeanVector m_connectionDescs; + CUtlLeanVector m_connectionDescs; }; inline CEntityKeyValues::Iterator_t CEntityKeyValues::First() const diff --git a/public/entity2/entitysystem.h b/public/entity2/entitysystem.h index 9d219dd1..57f11241 100644 --- a/public/entity2/entitysystem.h +++ b/public/entity2/entitysystem.h @@ -229,7 +229,9 @@ private: CEntityHandle m_hEnt; CEntityInstance* m_pEnt; const CEntityKeyValues* m_pKeyValues; - bool m_Unk1; + + // AMNOTE: Seems to be checked along side m_pKeyValues before its usage + bool m_bEntityKeyValuesInitialized; }; struct DestructionInfo_t diff --git a/public/tier1/utlleanvector.h b/public/tier1/utlleanvector.h index 5512375c..e43c8db9 100644 --- a/public/tier1/utlleanvector.h +++ b/public/tier1/utlleanvector.h @@ -363,7 +363,7 @@ public: }; Iterator_t First() const { const T* base = this->Base(); return Iterator_t( base, &base[ this->m_nCount ] ); } Iterator_t Next( const Iterator_t &it ) const { return Iterator_t( it.elem + 1, it.end ); } - bool IsValidIterator( const Iterator_t &it ) const { return it.elem != it.end; } + bool IsValidIterator( const Iterator_t &it ) const { return it.elem && it.elem != it.end; } T& operator[]( const Iterator_t &it ) { return *const_cast(it.elem); } const T& operator[]( const Iterator_t &it ) const { return *it.elem; }