You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When parsing Source 2 demos and calling Entity.Properties(), the return value will not include properties such as a.b if both a and b are both composite types (i.e. arrays or record types). For example CCSPlayerPawn.m_pWeaponServices.m_hMyWeapons, which is an array type, will not be returned. Similarly, CCSPlayerPawn.m_attributes (which is an array of records) is not listed at all.
To Reproduce
Parse any CS2 demo, and at any point where a player pawn entity is available, call entity.Properties and print the names of the returned properties. m_pWeaponServices.m_hMyWeapons is absent
Expected behavior
See above
Library version
v4.0.0-beta2
Additional context
Problem seems to come from method sendtables2.field.getFieldPaths. When resolving a composite property, it calls state.get(fp) on the currentstate using the root-relativefp. For top level properties, this works fine as state will be the top-level state of the entity. For nested properties, however, it's going to be a problem. Take CCSPlayerPawn.m_pWeaponServices.m_hMyWeapons as an example: Here, state will be the value of m_pWeaponServices, which consists of 7 inner properties, while fp will be the root-relative path [86, 0]. So it starts by looking up value at index 86 on an object with only 7 properties, which fails.
The text was updated successfully, but these errors were encountered:
Describe the bug
When parsing Source 2 demos and calling
Entity.Properties()
, the return value will not include properties such asa.b
if botha
andb
are both composite types (i.e. arrays or record types). For exampleCCSPlayerPawn.m_pWeaponServices.m_hMyWeapons
, which is an array type, will not be returned. Similarly,CCSPlayerPawn.m_attributes
(which is an array of records) is not listed at all.To Reproduce
Parse any CS2 demo, and at any point where a player pawn entity is available, call
entity.Properties
and print the names of the returned properties.m_pWeaponServices.m_hMyWeapons
is absentExpected behavior
See above
Library version
v4.0.0-beta2
Additional context
Problem seems to come from method
sendtables2.field.getFieldPaths
. When resolving a composite property, it callsstate.get(fp)
on the currentstate
using the root-relativefp
. For top level properties, this works fine asstate
will be the top-level state of the entity. For nested properties, however, it's going to be a problem. TakeCCSPlayerPawn.m_pWeaponServices.m_hMyWeapons
as an example: Here,state
will be the value ofm_pWeaponServices
, which consists of 7 inner properties, whilefp
will be the root-relative path[86, 0]
. So it starts by looking up value at index 86 on an object with only 7 properties, which fails.The text was updated successfully, but these errors were encountered: