-
Notifications
You must be signed in to change notification settings - Fork 115
Description
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 current state using the root-relative fp. 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.