From cf137b54adb9d32b2afd283d7cf2b003fe462b08 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 28 Jun 2004 18:54:58 +0000 Subject: [PATCH] PM's fix: engclient_cmd is now client_cmd --- amxmodx/file.cpp | 3 ++- amxmodx/meta_api.cpp | 4 ++++ amxmodx/util.cpp | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/amxmodx/file.cpp b/amxmodx/file.cpp index 27c00883..a43f1bb7 100755 --- a/amxmodx/file.cpp +++ b/amxmodx/file.cpp @@ -269,7 +269,8 @@ static cell AMX_NATIVE_CALL file_size(AMX *amx, cell *params) /* 1 param */ // Important update - now uses new handles static cell AMX_NATIVE_CALL amx_fopen(AMX *amx, cell *params) { - int len, i, j=-1; + unsigned int i; + int len, j=-1; char *file = build_pathname("%s", get_amxstring(amx, params[1], 1, len)); char *flags = get_amxstring(amx, params[2], 0, len); FILE *fp = fopen(file, flags); diff --git a/amxmodx/meta_api.cpp b/amxmodx/meta_api.cpp index 6bbf263f..e854ccc8 100755 --- a/amxmodx/meta_api.cpp +++ b/amxmodx/meta_api.cpp @@ -922,6 +922,7 @@ void C_MessageEnd_Post(void) { RETURN_META(MRES_IGNORED); } +#if 0 const char *C_Cmd_Args( void ) { // if the global "fake" flag is set, which means that engclient_cmd was used, supercede the function @@ -948,6 +949,7 @@ int C_Cmd_Argc( void ) // otherwise ignore it RETURN_META_VALUE(MRES_IGNORED, 0); } +#endif // Grenade has been thrown. // Only here we may find out who is an owner. @@ -1230,9 +1232,11 @@ C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *inte g_bmod_dod = !stricmp(g_mod_name.str(),"dod"); } +#if 0 meta_engfuncs.pfnCmd_Argc = C_Cmd_Argc; meta_engfuncs.pfnCmd_Argv = C_Cmd_Argv; meta_engfuncs.pfnCmd_Args = C_Cmd_Args; +#endif meta_engfuncs.pfnPrecacheModel = C_PrecacheModel; meta_engfuncs.pfnPrecacheSound = C_PrecacheSound; diff --git a/amxmodx/util.cpp b/amxmodx/util.cpp index 113f4bae..4f330909 100755 --- a/amxmodx/util.cpp +++ b/amxmodx/util.cpp @@ -252,6 +252,18 @@ void UTIL_ClientPrint( edict_t *pEntity, int msg_dest, char *msg ) // 4) unsets the global "fake" flag void UTIL_FakeClientCommand(edict_t *pEdict, const char *cmd, const char *arg1, const char *arg2) { + if (!cmd) + return; // no command + + char clCmd[256]; + snprintf(g_fakecmd.args, 255, "%s%s%s%s%s", cmd, + arg1 ? " " : "", arg1 ? arg1 : "", + arg2 ? " " : "", arg2 ? arg2 : ""); + clCmd[255] = 0; + CLIENT_COMMAND(pEdict, clCmd); + return; +#if 0 + /* if (!cmd) return; // no command @@ -295,4 +307,6 @@ void UTIL_FakeClientCommand(edict_t *pEdict, const char *cmd, const char *arg1, MDLL_ClientCommand(pEdict); // unset the global "fake" flag g_fakecmd.fake = false; + */ +#endif }