Replace some gamedata lookups with VScript function bindings - #459
Draft
komashchenko wants to merge 2 commits into
Draft
Replace some gamedata lookups with VScript function bindings#459komashchenko wants to merge 2 commits into
komashchenko wants to merge 2 commits into
Conversation
Contributor
|
I would've had concerns about VScript (or even just the CS2 bindings) being cleaned up from the game in the past. But given we're 3 years in to CS2 now, and it's all still there. I don't see any reason why we can't abuse them if they're sticking around, this would've been more stable than relying on signatures/offsets, anyway. Worst case we just revert back to signatures/offsets if Valve does ever go ahead with VScript cleanup. I would suggest sticking with "VScript" naming to avoid any confusion with cs_script though. I'll do a more thorough review once this is no longer marked as draft. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Although VScript itself is disabled, its function bindings are still registered and can be accessed through
CGameEntitySystem.This PR replaces several gamedata signatures and offsets with runtime lookups for the following function bindings:
SetGravitySetEntityNameEmitSoundParamsSetTeam(ChangeTeam)IsPlayerPawnIsPlayerControllerSetModelcould also be resolved this way, but it is currently hooked, so it is intentionally left unchanged.Teleportcould potentially be obtained throughSetOrigin.Since the function bindings cannot be resolved before
StartupServeris called, the appropriate failure behavior still needs to be determined. For now, lookup failures are reported throughPanic, although it may be better to simply usePlat_FatalErrorinstead.