1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-19 12:06:07 +08:00

Update NetworkStateChangedData & add missing initializer_list include

This commit is contained in:
GAMMACASE
2025-08-07 14:04:04 +03:00
parent c074421767
commit c2fa9d529a

View File

@ -9,6 +9,7 @@
#include "entity2/entityidentity.h" #include "entity2/entityidentity.h"
#include "variant.h" #include "variant.h"
#include "schemasystem/schematypes.h" #include "schemasystem/schematypes.h"
#include <initializer_list>
class CEntityKeyValues; class CEntityKeyValues;
class CFieldPath; class CFieldPath;
@ -20,9 +21,9 @@ struct datamap_t;
struct NetworkStateChangedData struct NetworkStateChangedData
{ {
inline NetworkStateChangedData() : m_unk001(1), m_FieldOffset(-1), m_nArrayIndex(-1), m_nPathIndex(ChangeAccessorFieldPathIndex_t()), m_unk101(0) { } inline NetworkStateChangedData() : m_unk001(1), m_nLine(-1), m_nArrayIndex(-1), m_nPathIndex(ChangeAccessorFieldPathIndex_t()), m_unk101(0) { }
inline explicit NetworkStateChangedData( bool bFullChanged ) : inline explicit NetworkStateChangedData( bool bFullChanged ) :
m_unk001(static_cast<uint32>(!bFullChanged)), m_FieldOffset(-1), m_unk001(static_cast<uint32>(!bFullChanged)), m_nLine(-1),
m_nArrayIndex(-1), m_nPathIndex(ChangeAccessorFieldPathIndex_t()), m_nArrayIndex(-1), m_nPathIndex(ChangeAccessorFieldPathIndex_t()),
m_unk101(0) m_unk101(0)
{ } { }
@ -36,13 +37,13 @@ struct NetworkStateChangedData
// if the path to the field goes through one or more pointers, otherwise pass -1 // if the path to the field goes through one or more pointers, otherwise pass -1
// this value is usually a member of the CNetworkVarChainer and belongs to the last object in the chain // this value is usually a member of the CNetworkVarChainer and belongs to the last object in the chain
inline NetworkStateChangedData( uint32 nLocalOffset, int32 nArrayIndex = -1, ChangeAccessorFieldPathIndex_t nPathIndex = ChangeAccessorFieldPathIndex_t() ) : inline NetworkStateChangedData( uint32 nLocalOffset, int32 nArrayIndex = -1, ChangeAccessorFieldPathIndex_t nPathIndex = ChangeAccessorFieldPathIndex_t() ) :
m_unk001(1), m_LocalOffsets(0, 1), m_FieldOffset(-1), m_nArrayIndex(nArrayIndex), m_nPathIndex(nPathIndex), m_unk101(0) m_unk001(1), m_LocalOffsets(0, 1), m_nLine(-1), m_nArrayIndex(nArrayIndex), m_nPathIndex(nPathIndex), m_unk101(0)
{ {
m_LocalOffsets.AddToHead(nLocalOffset); m_LocalOffsets.AddToHead(nLocalOffset);
} }
inline NetworkStateChangedData(const std::initializer_list< uint32 > nLocalOffsets, int32 nArrayIndex = -1, ChangeAccessorFieldPathIndex_t nPathIndex = ChangeAccessorFieldPathIndex_t()) : inline NetworkStateChangedData(const std::initializer_list< uint32 > nLocalOffsets, int32 nArrayIndex = -1, ChangeAccessorFieldPathIndex_t nPathIndex = ChangeAccessorFieldPathIndex_t()) :
m_unk001(1), m_LocalOffsets(0, nLocalOffsets.size()), m_FieldOffset(-1), m_nArrayIndex(nArrayIndex), m_nPathIndex(nPathIndex), m_unk101(1) m_unk001(1), m_LocalOffsets(0, nLocalOffsets.size()), m_nLine(-1), m_nArrayIndex(nArrayIndex), m_nPathIndex(nPathIndex), m_unk101(1)
{ {
for ( const uint32& nLocalOffset : nLocalOffsets ) for ( const uint32& nLocalOffset : nLocalOffsets )
{ {
@ -54,9 +55,9 @@ struct NetworkStateChangedData
CUtlVector<uint32> m_LocalOffsets; CUtlVector<uint32> m_LocalOffsets;
// AMNOTE: Mostly unused/debug // AMNOTE: Mostly unused/debug
CUtlString m_ClassName;
CUtlString m_FieldName; CUtlString m_FieldName;
int32 m_FieldOffset; CUtlString m_FileName;
int32 m_nLine;
int32 m_nArrayIndex; int32 m_nArrayIndex;
ChangeAccessorFieldPathIndex_t m_nPathIndex; ChangeAccessorFieldPathIndex_t m_nPathIndex;