Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

CS2: Entity.Properties() does not include second level properties of composite types #441

Open
@esbengc

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /