1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-19 20:16:10 +08:00

Correct FCVAR flags being int32 & handle ConVarRefAbstract invalidation

This commit is contained in:
GAMMACASE
2025-02-16 00:16:12 +03:00
parent 9dc649cfdc
commit 7678f00e41
2 changed files with 33 additions and 31 deletions

View File

@ -186,23 +186,23 @@ struct CVarCreationBase_t
// Command to ConVars and ConCommands
// ConVar Systems
#define FCVAR_LINKED_CONCOMMAND (1<<0) // Allows concommand callback chaining. When command is dispatched all chained callbacks would fire.
#define FCVAR_DEVELOPMENTONLY (1<<1) // Hidden in released products. Flag is removed automatically if ALLOW_DEVELOPMENT_CVARS is defined.
#define FCVAR_GAMEDLL (1<<2) // defined by the game DLL
#define FCVAR_CLIENTDLL (1<<3) // defined by the client DLL
#define FCVAR_HIDDEN (1<<4) // Hidden. Doesn't appear in find or auto complete. Like DEVELOPMENTONLY, but can't be compiled out.
#define FCVAR_LINKED_CONCOMMAND (1ull<<0) // Allows concommand callback chaining. When command is dispatched all chained callbacks would fire.
#define FCVAR_DEVELOPMENTONLY (1ull<<1) // Hidden in released products. Flag is removed automatically if ALLOW_DEVELOPMENT_CVARS is defined.
#define FCVAR_GAMEDLL (1ull<<2) // defined by the game DLL
#define FCVAR_CLIENTDLL (1ull<<3) // defined by the client DLL
#define FCVAR_HIDDEN (1ull<<4) // Hidden. Doesn't appear in find or auto complete. Like DEVELOPMENTONLY, but can't be compiled out.
// ConVar only
#define FCVAR_PROTECTED (1<<5) // It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value
#define FCVAR_SPONLY (1<<6) // This cvar cannot be changed by clients connected to a multiplayer server.
#define FCVAR_ARCHIVE (1<<7) // set to cause it to be saved to vars.rc
#define FCVAR_NOTIFY (1<<8) // notifies players when changed
#define FCVAR_USERINFO (1<<9) // changes the client's info string
#define FCVAR_PROTECTED (1ull<<5) // It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value
#define FCVAR_SPONLY (1ull<<6) // This cvar cannot be changed by clients connected to a multiplayer server.
#define FCVAR_ARCHIVE (1ull<<7) // set to cause it to be saved to vars.rc
#define FCVAR_NOTIFY (1ull<<8) // notifies players when changed
#define FCVAR_USERINFO (1ull<<9) // changes the client's info string
#define FCVAR_REFERENCE (1<<10) // Means cvar is a reference, usually used to get a cvar reference of a cvar registered in other module,
#define FCVAR_REFERENCE (1ull<<10) // Means cvar is a reference, usually used to get a cvar reference of a cvar registered in other module,
// and is temporary until the actual cvar was registered
#define FCVAR_UNLOGGED (1<<11) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log
#define FCVAR_INITIAL_SETVALUE (1<<12) // Is set for a first convar SetValue either with its default_value or with a value from a gameinfo.
#define FCVAR_UNLOGGED (1ull<<11) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log
#define FCVAR_INITIAL_SETVALUE (1ull<<12) // Is set for a first convar SetValue either with its default_value or with a value from a gameinfo.
// Mostly for callbacks to check for.
// It's a ConVar that's shared between the client and the server.
@ -210,30 +210,30 @@ struct CVarCreationBase_t
// client, of course )
// If a change is requested it must come from the console (i.e., no remote client changes)
// If a value is changed while a server is active, it's replicated to all connected clients
#define FCVAR_REPLICATED (1<<13) // server setting enforced on clients, TODO rename to FCAR_SERVER at some time
#define FCVAR_CHEAT (1<<14) // Only useable in singleplayer / debug / multiplayer & sv_cheats
#define FCVAR_PER_USER (1<<15) // causes varnameN where N == 2 through max splitscreen slots for mod to be autogenerated
#define FCVAR_DEMO (1<<16) // record this cvar when starting a demo file
#define FCVAR_DONTRECORD (1<<17) // don't record these command in demofiles
#define FCVAR_PERFORMING_CALLBACKS (1<<18) // Is set when cvar is calling to its callbacks from CallChangeCallback or CallGlobalChangeCallbacks,
#define FCVAR_REPLICATED (1ull<<13) // server setting enforced on clients, TODO rename to FCAR_SERVER at some time
#define FCVAR_CHEAT (1ull<<14) // Only useable in singleplayer / debug / multiplayer & sv_cheats
#define FCVAR_PER_USER (1ull<<15) // causes varnameN where N == 2 through max splitscreen slots for mod to be autogenerated
#define FCVAR_DEMO (1ull<<16) // record this cvar when starting a demo file
#define FCVAR_DONTRECORD (1ull<<17) // don't record these command in demofiles
#define FCVAR_PERFORMING_CALLBACKS (1ull<<18) // Is set when cvar is calling to its callbacks from CallChangeCallback or CallGlobalChangeCallbacks,
// usually means if you set the value during these callbacks, its value would be queued and set when all callbacks were fired
#define FCVAR_RELEASE (1<<19) // Cvars tagged with this are the only cvars avaliable to customers
#define FCVAR_MENUBAR_ITEM (1<<20)
#define FCVAR_COMMANDLINE_ENFORCED (1<<21) // If cvar was set via launch options it would not be reset on calls to ResetConVarsToDefaultValuesByFlag
#define FCVAR_RELEASE (1ull<<19) // Cvars tagged with this are the only cvars avaliable to customers
#define FCVAR_MENUBAR_ITEM (1ull<<20)
#define FCVAR_COMMANDLINE_ENFORCED (1ull<<21) // If cvar was set via launch options it would not be reset on calls to ResetConVarsToDefaultValuesByFlag
#define FCVAR_NOT_CONNECTED (1<<22) // cvar cannot be changed by a client that is connected to a server
#define FCVAR_VCONSOLE_FUZZY_MATCHING (1<<23)
#define FCVAR_NOT_CONNECTED (1ull<<22) // cvar cannot be changed by a client that is connected to a server
#define FCVAR_VCONSOLE_FUZZY_MATCHING (1ull<<23)
#define FCVAR_SERVER_CAN_EXECUTE (1<<24) // the server is allowed to execute this command on clients via ClientCommand/NET_StringCmd/CBaseClientState::ProcessStringCmd.
#define FCVAR_CLIENT_CAN_EXECUTE (1<<25) // Assigned to commands to let clients execute them
#define FCVAR_SERVER_CANNOT_QUERY (1<<26) // If this is set, then the server is not allowed to query this cvar's value (via IServerPluginHelpers::StartQueryCvarValue).
#define FCVAR_VCONSOLE_SET_FOCUS (1<<27)
#define FCVAR_CLIENTCMD_CAN_EXECUTE (1<<28) // IVEngineClient::ClientCmd is allowed to execute this command.
#define FCVAR_SERVER_CAN_EXECUTE (1ull<<24) // the server is allowed to execute this command on clients via ClientCommand/NET_StringCmd/CBaseClientState::ProcessStringCmd.
#define FCVAR_CLIENT_CAN_EXECUTE (1ull<<25) // Assigned to commands to let clients execute them
#define FCVAR_SERVER_CANNOT_QUERY (1ull<<26) // If this is set, then the server is not allowed to query this cvar's value (via IServerPluginHelpers::StartQueryCvarValue).
#define FCVAR_VCONSOLE_SET_FOCUS (1ull<<27)
#define FCVAR_CLIENTCMD_CAN_EXECUTE (1ull<<28) // IVEngineClient::ClientCmd is allowed to execute this command.
// Note: IVEngineClient::ClientCmd_Unrestricted can run any client command.
#define FCVAR_EXECUTE_PER_TICK (1<<29)
#define FCVAR_EXECUTE_PER_TICK (1ull<<29)
#define FCVAR_DEFENSIVE (1<<32)
#define FCVAR_DEFENSIVE (1ull<<32)
//-----------------------------------------------------------------------------

View File

@ -557,6 +557,8 @@ void ConVarRefAbstract::Init( ConVarRef ref, EConVarType type )
void ConVarRefAbstract::InvalidateConVarData( EConVarType type )
{
InvalidateRef();
if(type == EConVarType_Invalid)
m_ConVarData = GetInvalidConVarData( EConVarType_Invalid );
else