Skip to content

Fix vscript variant EHANDLE conversions#1948

Open
Mikusch wants to merge 1 commit into
ValveSoftware:masterfrom
Mikusch:vscript-variant-fix
Open

Fix vscript variant EHANDLE conversions#1948
Mikusch wants to merge 1 commit into
ValveSoftware:masterfrom
Mikusch:vscript-variant-fix

Conversation

@Mikusch

@Mikusch Mikusch commented Jun 4, 2026

Copy link
Copy Markdown

CVariantBase FIELD_EHANDLE conversions build a handle from the raw m_hEntity index by calling CBaseHandle( m_hEntity ) and CHandle<CBaseEntity>( m_hEntity ), but neither type has a constructor that takes a raw index. This means anything using these will fail to compile, which is not a problem in the SDK as-is but could be problematic for users of the public headers.

Use the UnsafeFromIndex factory, which is provided for exactly this (rebuilding from a ToInt() value).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant