Fix
This commit is contained in:
parent
799a7583ef
commit
ab3d0b789d
@ -86,6 +86,23 @@ namespace Components
|
||||
}
|
||||
}
|
||||
|
||||
Game::cmd_function_t* Command::Find(std::string command)
|
||||
{
|
||||
Game::cmd_function_t* cmdFunction = *Game::cmd_functions;
|
||||
|
||||
while (cmdFunction)
|
||||
{
|
||||
if (cmdFunction->name && cmdFunction->name == command)
|
||||
{
|
||||
return cmdFunction;
|
||||
}
|
||||
|
||||
cmdFunction = cmdFunction->next;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Game::cmd_function_t* Command::Allocate()
|
||||
{
|
||||
Game::cmd_function_t* cmd = new Game::cmd_function_t;
|
||||
|
@ -33,6 +33,8 @@ namespace Components
|
||||
static void AddRawSV(const char* name, void(*callback)());
|
||||
static void Execute(std::string command, bool sync = true);
|
||||
|
||||
static Game::cmd_function_t* Find(std::string command);
|
||||
|
||||
private:
|
||||
static Game::cmd_function_t* Allocate();
|
||||
static std::vector<Game::cmd_function_t*> Functions;
|
||||
|
@ -120,9 +120,13 @@ namespace Components
|
||||
|
||||
if (args.Length() >= 4)
|
||||
{
|
||||
Game::dvar_t* dvar = Game::Dvar_FindVar(args[3]);
|
||||
std::string cmd = args[0];
|
||||
std::string table = args[1];
|
||||
std::string col = args[2];
|
||||
std::string dvarName = args[3];
|
||||
Game::dvar_t* dvar = Game::Dvar_FindVar(dvarName.data());
|
||||
|
||||
if (!dvar || dvar->flags & Game::DVAR_FLAG_WRITEPROTECTED || dvar->flags & Game::DVAR_FLAG_CHEAT || dvar->flags & Game::DVAR_FLAG_READONLY)
|
||||
if (Command::Find(dvarName) || (dvar && (dvar->flags & Game::DVAR_FLAG_WRITEPROTECTED || dvar->flags & Game::DVAR_FLAG_CHEAT || dvar->flags & Game::DVAR_FLAG_READONLY)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -199,6 +199,8 @@ namespace Game
|
||||
DWORD* cmd_argc_sv = (DWORD*)0x1ACF8E4;
|
||||
char*** cmd_argv_sv = (char***)0x1ACF904;
|
||||
|
||||
cmd_function_t** cmd_functions = (cmd_function_t**)0x1AAC658;
|
||||
|
||||
source_t **sourceFiles = (source_t **)0x7C4A98;
|
||||
keywordHash_t **menuParseKeywordHash = (keywordHash_t **)0x63AE928;
|
||||
|
||||
|
@ -442,6 +442,8 @@ namespace Game
|
||||
extern DWORD* cmd_argc_sv;
|
||||
extern char*** cmd_argv_sv;
|
||||
|
||||
extern cmd_function_t** cmd_functions;
|
||||
|
||||
extern int* svs_numclients;
|
||||
extern client_t* svs_clients;
|
||||
|
||||
|
@ -131,7 +131,12 @@ namespace Game
|
||||
|
||||
typedef struct cmd_function_s
|
||||
{
|
||||
char pad[24];
|
||||
cmd_function_s *next;
|
||||
const char *name;
|
||||
const char *autoCompleteDir;
|
||||
const char *autoCompleteExt;
|
||||
void(__cdecl *function)();
|
||||
int pad;
|
||||
} cmd_function_t;
|
||||
|
||||
typedef struct
|
||||
|
Loading…
Reference in New Issue
Block a user