mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-04 02:55:50 +03:00
Added Cmd_RemoveCmd to ReHlds API
This commit is contained in:
parent
dace70e2b1
commit
d75af4a219
@ -668,10 +668,8 @@ NOXREF cmd_function_t *Cmd_FindCmd(char *cmd_name)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
NOXREF cmd_function_t *Cmd_FindCmdPrev(char *cmd_name)
|
cmd_function_t *Cmd_FindCmdPrev(char *cmd_name)
|
||||||
{
|
{
|
||||||
NOXREFCHECK;
|
|
||||||
|
|
||||||
cmd_function_t *cmd = NULL;
|
cmd_function_t *cmd = NULL;
|
||||||
|
|
||||||
if (cmd_functions == NULL)
|
if (cmd_functions == NULL)
|
||||||
@ -795,6 +793,19 @@ void EXT_FUNC Cmd_AddGameCommand(char *cmd_name, xcommand_t function)
|
|||||||
Cmd_AddMallocCommand(cmd_name, function, FCMD_GAME_COMMAND);
|
Cmd_AddMallocCommand(cmd_name, function, FCMD_GAME_COMMAND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EXT_FUNC Cmd_RemoveCmd(char *cmd_name)
|
||||||
|
{
|
||||||
|
auto prev = Cmd_FindCmdPrev(cmd_name);
|
||||||
|
|
||||||
|
if (prev) {
|
||||||
|
auto cmd = prev->next;
|
||||||
|
prev->next = cmd->next;
|
||||||
|
|
||||||
|
Z_Free(cmd->name);
|
||||||
|
Mem_Free(cmd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Cmd_RemoveMallocedCmds(int flag)
|
void Cmd_RemoveMallocedCmds(int flag)
|
||||||
{
|
{
|
||||||
cmd_function_t *c, **p;
|
cmd_function_t *c, **p;
|
||||||
|
@ -103,12 +103,13 @@ const char *Cmd_Argv(int arg);
|
|||||||
const char *Cmd_Args(void);
|
const char *Cmd_Args(void);
|
||||||
void Cmd_TokenizeString(char *text);
|
void Cmd_TokenizeString(char *text);
|
||||||
NOXREF cmd_function_t *Cmd_FindCmd(char *cmd_name);
|
NOXREF cmd_function_t *Cmd_FindCmd(char *cmd_name);
|
||||||
NOXREF cmd_function_t *Cmd_FindCmdPrev(char *cmd_name);
|
cmd_function_t *Cmd_FindCmdPrev(char *cmd_name);
|
||||||
void Cmd_AddCommand(char *cmd_name, xcommand_t function);
|
void Cmd_AddCommand(char *cmd_name, xcommand_t function);
|
||||||
void Cmd_AddMallocCommand(char *cmd_name, xcommand_t function, int flag);
|
void Cmd_AddMallocCommand(char *cmd_name, xcommand_t function, int flag);
|
||||||
NOXREF void Cmd_AddHUDCommand(char *cmd_name, xcommand_t function);
|
NOXREF void Cmd_AddHUDCommand(char *cmd_name, xcommand_t function);
|
||||||
NOXREF void Cmd_AddWrapperCommand(char *cmd_name, xcommand_t function);
|
NOXREF void Cmd_AddWrapperCommand(char *cmd_name, xcommand_t function);
|
||||||
void Cmd_AddGameCommand(char *cmd_name, xcommand_t function);
|
void Cmd_AddGameCommand(char *cmd_name, xcommand_t function);
|
||||||
|
void Cmd_RemoveCmd(char *cmd_name);
|
||||||
void Cmd_RemoveMallocedCmds(int flag);
|
void Cmd_RemoveMallocedCmds(int flag);
|
||||||
NOXREF void Cmd_RemoveHudCmds(void);
|
NOXREF void Cmd_RemoveHudCmds(void);
|
||||||
void Cmd_RemoveGameCmds(void);
|
void Cmd_RemoveGameCmds(void);
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include "model.h"
|
#include "model.h"
|
||||||
|
|
||||||
#define REHLDS_API_VERSION_MAJOR 3
|
#define REHLDS_API_VERSION_MAJOR 3
|
||||||
#define REHLDS_API_VERSION_MINOR 0
|
#define REHLDS_API_VERSION_MINOR 1
|
||||||
|
|
||||||
//Steam_NotifyClientConnect hook
|
//Steam_NotifyClientConnect hook
|
||||||
typedef IHookChain<qboolean, IGameClient*, const void*, unsigned int> IRehldsHook_Steam_NotifyClientConnect;
|
typedef IHookChain<qboolean, IGameClient*, const void*, unsigned int> IRehldsHook_Steam_NotifyClientConnect;
|
||||||
@ -282,6 +282,7 @@ struct RehldsFuncs_t {
|
|||||||
bool(*SV_EmitSound2)(edict_t *entity, IGameClient *receiver, int channel, const char *sample, float volume, float attenuation, int flags, int pitch, int emitFlags, const float *pOrigin);
|
bool(*SV_EmitSound2)(edict_t *entity, IGameClient *receiver, int channel, const char *sample, float volume, float attenuation, int flags, int pitch, int emitFlags, const float *pOrigin);
|
||||||
void(*SV_UpdateUserInfo)(IGameClient *pGameClient);
|
void(*SV_UpdateUserInfo)(IGameClient *pGameClient);
|
||||||
bool(*StripUnprintableAndSpace)(char *pch);
|
bool(*StripUnprintableAndSpace)(char *pch);
|
||||||
|
void(*Cmd_RemoveCmd)(char *cmd_name);
|
||||||
};
|
};
|
||||||
|
|
||||||
class IRehldsApi {
|
class IRehldsApi {
|
||||||
|
@ -210,7 +210,8 @@ RehldsFuncs_t g_RehldsApiFuncs =
|
|||||||
&SV_StartSound_api,
|
&SV_StartSound_api,
|
||||||
&SV_EmitSound2_api,
|
&SV_EmitSound2_api,
|
||||||
&SV_UpdateUserInfo_api,
|
&SV_UpdateUserInfo_api,
|
||||||
&StripUnprintableAndSpace_api
|
&StripUnprintableAndSpace_api,
|
||||||
|
&Cmd_RemoveCmd
|
||||||
};
|
};
|
||||||
|
|
||||||
bool EXT_FUNC SV_EmitSound2_internal(edict_t *entity, IGameClient *pReceiver, int channel, const char *sample, float volume, float attenuation, int flags, int pitch, int emitFlags, const float *pOrigin)
|
bool EXT_FUNC SV_EmitSound2_internal(edict_t *entity, IGameClient *pReceiver, int channel, const char *sample, float volume, float attenuation, int flags, int pitch, int emitFlags, const float *pOrigin)
|
||||||
|
Loading…
Reference in New Issue
Block a user