From 2e6dc308a8659cfe977a38cb91107f4558977152 Mon Sep 17 00:00:00 2001 From: xPaw Date: Thu, 5 Jun 2014 23:33:45 +0300 Subject: [PATCH] :fire: Remove backwards compatible CreateMultiForwardEx --- amxmodx/CForward.cpp | 17 +++++------------ amxmodx/CForward.h | 10 +++------- amxmodx/amxmodx.cpp | 16 ---------------- plugins/include/amxconst.inc | 4 ---- plugins/include/amxmodx.inc | 8 -------- 5 files changed, 8 insertions(+), 47 deletions(-) diff --git a/amxmodx/CForward.cpp b/amxmodx/CForward.cpp index aa0c4230..1adb6acb 100755 --- a/amxmodx/CForward.cpp +++ b/amxmodx/CForward.cpp @@ -33,7 +33,7 @@ #include "debugger.h" #include "binlog.h" -CForward::CForward(const char *name, ForwardExecType et, int numParams, const ForwardParam *paramTypes, int fwd_type) +CForward::CForward(const char *name, ForwardExecType et, int numParams, const ForwardParam *paramTypes) { m_FuncName = name; m_ExecType = et; @@ -47,13 +47,6 @@ CForward::CForward(const char *name, ForwardExecType et, int numParams, const Fo for (CPluginMngr::iterator iter = g_plugins.begin(); iter; ++iter) { - if ((fwd_type != FORWARD_ALL) && - ((fwd_type == FORWARD_ONLY_NEW && ((*iter).getAMX()->flags & AMX_FLAG_OLDFILE)) - || (fwd_type == FORWARD_ONLY_OLD && !((*iter).getAMX()->flags & AMX_FLAG_OLDFILE)) - )) - { - continue; - } if ((*iter).isValid() && amx_FindPublic((*iter).getAMX(), name, &func) == AMX_ERR_NONE) { AMXForward tmp; @@ -367,10 +360,10 @@ cell CSPForward::execute(cell *params, ForwardPreparedArray *preparedArrays) return retVal; } -int CForwardMngr::registerForward(const char *funcName, ForwardExecType et, int numParams, const ForwardParam * paramTypes, int fwd_type) +int CForwardMngr::registerForward(const char *funcName, ForwardExecType et, int numParams, const ForwardParam * paramTypes) { int retVal = m_Forwards.size() << 1; - CForward *tmp = new CForward(funcName, et, numParams, paramTypes, fwd_type); + CForward *tmp = new CForward(funcName, et, numParams, paramTypes); if (!tmp) { @@ -590,7 +583,7 @@ int CForwardMngr::isSameSPForward(int id1, int id2) && (fwd1->m_NumParams == fwd2->m_NumParams)); } -int registerForwardC(const char *funcName, ForwardExecType et, cell *list, size_t num, int fwd_type) +int registerForwardC(const char *funcName, ForwardExecType et, cell *list, size_t num) { ForwardParam params[FORWARD_MAX_PARAMS]; @@ -599,7 +592,7 @@ int registerForwardC(const char *funcName, ForwardExecType et, cell *list, size_ params[i] = static_cast(list[i]); } - return g_forwards.registerForward(funcName, et, num, params, fwd_type); + return g_forwards.registerForward(funcName, et, num, params); } int registerForward(const char *funcName, ForwardExecType et, ...) diff --git a/amxmodx/CForward.h b/amxmodx/CForward.h index d69a7201..02c36174 100755 --- a/amxmodx/CForward.h +++ b/amxmodx/CForward.h @@ -51,10 +51,6 @@ const int FORWARD_MAX_PARAMS = 32; -#define FORWARD_ONLY_OLD 1 -#define FORWARD_ONLY_NEW 2 -#define FORWARD_ALL 3 - enum ForwardExecType { ET_IGNORE = 0, // Ignore return vaue @@ -111,7 +107,7 @@ class CForward ForwardParam m_ParamTypes[FORWARD_MAX_PARAMS]; public: - CForward(const char *name, ForwardExecType et, int numParams, const ForwardParam * paramTypes, int fwd_type=FORWARD_ALL); + CForward(const char *name, ForwardExecType et, int numParams, const ForwardParam * paramTypes); CForward() {} // leaves everything unitialized' cell execute(cell *params, ForwardPreparedArray *preparedArrays); @@ -209,7 +205,7 @@ public: // Interface // Register normal forward - int registerForward(const char *funcName, ForwardExecType et, int numParams, const ForwardParam *paramTypes, int fwd_type=FORWARD_ALL); + int registerForward(const char *funcName, ForwardExecType et, int numParams, const ForwardParam *paramTypes); // Register single plugin forward int registerSPForward(const char *funcName, AMX *amx, int numParams, const ForwardParam * paramTypes); int registerSPForward(int func, AMX *amx, int numParams, const ForwardParam * paramTypes); @@ -235,7 +231,7 @@ public: // (un)register forward int registerForward(const char *funcName, ForwardExecType et, ...); -int registerForwardC(const char *funcName, ForwardExecType et, cell *list, size_t num, int fwd_type=FORWARD_ALL); +int registerForwardC(const char *funcName, ForwardExecType et, cell *list, size_t num); int registerSPForwardByName(AMX *amx, const char *funcName, ...); int registerSPForwardByNameC(AMX *amx, const char *funcName, cell *list, size_t num); int registerSPForward(AMX *amx, int func, ...); diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index 94c0b00c..09f1ada4 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -4325,21 +4325,6 @@ static cell AMX_NATIVE_CALL CreateMultiForward(AMX *amx, cell *params) return registerForwardC(funcname, static_cast(params[2]), ps, count-2); } -static cell AMX_NATIVE_CALL CreateMultiForwardEx(AMX *amx, cell *params) -{ - int len; - char *funcname = get_amxstring(amx, params[1], 0, len); - - cell ps[FORWARD_MAX_PARAMS]; - cell count = params[0] / sizeof(cell); - for (cell i=4; i<=count; i++) - { - ps[i-4] = *get_amxaddr(amx, params[i]); - } - - return registerForwardC(funcname, static_cast(params[2]), ps, count-3, params[3]); -} - static cell AMX_NATIVE_CALL CreateOneForward(AMX *amx, cell *params) { CPluginMngr::CPlugin *p = g_plugins.findPlugin(params[1]); @@ -5023,7 +5008,6 @@ AMX_NATIVE_INFO amxmodx_Natives[] = {"CreateHudSyncObj", CreateHudSyncObj}, {"CreateLangKey", CreateLangKey}, {"CreateMultiForward", CreateMultiForward}, - {"CreateMultiForwardEx", CreateMultiForwardEx}, {"CreateOneForward", CreateOneForward}, {"DestroyForward", DestroyForward}, {"ExecuteForward", ExecuteForward}, diff --git a/plugins/include/amxconst.inc b/plugins/include/amxconst.inc index 16c66bac..284e4281 100755 --- a/plugins/include/amxconst.inc +++ b/plugins/include/amxconst.inc @@ -302,10 +302,6 @@ enum { #define FP_STRING 2 #define FP_ARRAY 4 -#define FORWARD_ONLY_OLD 1 -#define FORWARD_ONLY_NEW 2 -#define FORWARD_ALL 3 - #define SND_SPAWNING (1<<8) // we're spawing, used in some cases for ambients #define SND_STOP (1<<5) // stop sound #define SND_CHANGE_VOL (1<<6) // change sound vol diff --git a/plugins/include/amxmodx.inc b/plugins/include/amxmodx.inc index 729b4c4e..674b0c99 100755 --- a/plugins/include/amxmodx.inc +++ b/plugins/include/amxmodx.inc @@ -1086,14 +1086,6 @@ native set_addr_val(addr, val); */ native CreateMultiForward(const name[], stop_type, ...); -/** - * Creates a multi-forward plugin that can filter between old/new plugins. - * Old plugins are used by the AMX Mod backwards compatibility layer. - * Stop type must be one of the ET_ values in amxconst.inc - * Forward type must be one of the FORWARD_ values in amxconst.inc. - */ -native CreateMultiForwardEx(const name[], stop_type, forward_type, ...); - /** * Creates a forward for one plugin. * Results will be > 0 for success.