[Command]: Fix definition of Cmd_AddCommand (#609)
This commit is contained in:
parent
9689682432
commit
c3d6b20644
@ -308,6 +308,27 @@ namespace Components
|
||||
}
|
||||
}
|
||||
|
||||
void Debug::Com_BugNameInc_f()
|
||||
{
|
||||
char buf[260]{};
|
||||
|
||||
if (std::strlen(BugName->current.string) < 4)
|
||||
{
|
||||
Game::Dvar_SetString(BugName, "bug0");
|
||||
return;
|
||||
}
|
||||
|
||||
if (strncmp(BugName->current.string, "bug", 3) != 0)
|
||||
{
|
||||
Game::Dvar_SetString(BugName, "bug0");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto n = std::strtol(BugName->current.string + 3, nullptr, 10);
|
||||
sprintf_s(buf, "bug%d", n + 1);
|
||||
Game::Dvar_SetString(BugName, buf);
|
||||
}
|
||||
|
||||
void Debug::CL_InitDebugDvars()
|
||||
{
|
||||
static const char* debugOverlayNames_0[] =
|
||||
@ -338,6 +359,7 @@ namespace Components
|
||||
|
||||
#ifdef _DEBUG
|
||||
Command::Add("bug", Com_Bug_f);
|
||||
Command::Add("bug_name_inc", Com_BugNameInc_f);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,7 @@ namespace Components
|
||||
|
||||
static void Com_Assert_f();
|
||||
static void Com_Bug_f(Command::Params* params);
|
||||
static void Com_BugNameInc_f();
|
||||
|
||||
static void CL_InitDebugDvars();
|
||||
};
|
||||
|
@ -48,7 +48,7 @@ namespace Game
|
||||
typedef void(*CG_SetupWeaponDef_t)(int localClientNum, unsigned int weapIndex);
|
||||
extern CG_SetupWeaponDef_t CG_SetupWeaponDef;
|
||||
|
||||
typedef void(*Cmd_AddCommand_t)(const char* cmdName, void(*function), cmd_function_t* allocedCmd, bool isKey);
|
||||
typedef void(*Cmd_AddCommand_t)(const char* cmdName, void(*function), cmd_function_t* allocedCmd, int isKey);
|
||||
extern Cmd_AddCommand_t Cmd_AddCommand;
|
||||
|
||||
typedef void(*Cmd_AddServerCommand_t)(const char* name, void(*callback), cmd_function_t* data);
|
||||
|
Loading…
Reference in New Issue
Block a user