Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added getcvar cuz yes (amalgram uses it) #214

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

M310DYR0CKS
Copy link

No description provided.

@M310DYR0CKS
Copy link
Author

@sapphonie can we push this thanks

@hellidox
Copy link

afaik amalgam doesnt actually register a cvar it just hooks clientcmd unrestricted

MAKE_HOOK(IVEngineClient_ClientCmd_Unrestricted, U::Memory.GetVFunc(I::EngineClient, 106), void,
    void* rcx, const char* szCmdString)
{
    //irrelevant removed
    if (!vArgs.empty())
    {
        std::string sCommand = vArgs.front();
        vArgs.pop_front();

        if (F::Commands.Run(sCommand, vArgs))
            return;
    }
    CALL_ORIGINAL(rcx, szCmdString);
}

https://github.com/rei-2/Amalgam/blob/31092f8baae7b7b61d9a11e66b034e112490e3d9/Amalgam/src/Hooks/IVEngineClient_ClientCmd_Unrestricted.cpp#L38
F::Commands is of type ccommands which is just a list of commands and callbacks
https://github.com/rei-2/Amalgam/blob/31092f8baae7b7b61d9a11e66b034e112490e3d9/Amalgam/src/Features/Commands/Commands.cpp#L9

@sapphonie
Copy link
Owner

sapphonie commented Feb 10, 2025

afaik amalgam doesnt actually register a cvar it just hooks clientcmd unrestricted

MAKE_HOOK(IVEngineClient_ClientCmd_Unrestricted, U::Memory.GetVFunc(I::EngineClient, 106), void,
    void* rcx, const char* szCmdString)
{
    //irrelevant removed
    if (!vArgs.empty())
    {
        std::string sCommand = vArgs.front();
        vArgs.pop_front();

        if (F::Commands.Run(sCommand, vArgs))
            return;
    }
    CALL_ORIGINAL(rcx, szCmdString);
}

https://github.com/rei-2/Amalgam/blob/31092f8baae7b7b61d9a11e66b034e112490e3d9/Amalgam/src/Hooks/IVEngineClient_ClientCmd_Unrestricted.cpp#L38
F::Commands is of type ccommands which is just a list of commands and callbacks
https://github.com/rei-2/Amalgam/blob/31092f8baae7b7b61d9a11e66b034e112490e3d9/Amalgam/src/Features/Commands/Commands.cpp#L9

AFAIK this won't show up as a cvar when queried by sm lol

@sapphonie
Copy link
Owner

@M310DYR0CKS can you test this please

@M310DYR0CKS
Copy link
Author

I can test it when i get a moment

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.

3 participants